alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (persistent_classes.po)

This example Hibernate source code file (persistent_classes.po) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

cat, cat, customer, hibernate, hibernate, klassen, map, pojo, sie, sie, string, tag, tag, the

The Hibernate persistent_classes.po source code

# translation of Collection_Mapping.po to 
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# Language /mnt/hgfs/base/Hibernate/Reference translations for PACKAGE package.
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
# Automatically generated, 2006.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
#
msgid ""
msgstr ""
"Project-Id-Version: Collection_Mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\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@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"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). 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 "
"Bestellung in einer E-Commerce Applikation) implementieren. Nicht alle "
"Instanzen einer persistenten Klasse werden als im persistenten Status "
"befindlich angesehen - eine Instanz kann statt dessen auch kurzlebig "
"(\"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, 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 "
"instances, for example)."
msgstr ""
"Hibernate funktioniert am besten, wenn diese Klassen einigen einfachen "
"Regeln folgen, die auch als \"Plain Old Java Object\" (POJO) "
"Programmiermodell bekannt sind. Keine dieser Regeln sind jedoch feste "
"Anforderungen. Tatsächlich setzt Hibernate3 sehr wenig hinsichtlich des "
"Charakters Ihrer persistenten Objekte voraus. Sie können ein Domain-Modell "
"auf andere Weise ausdrücken: Zum Beispiel unter Verwendung von <literal>Map 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>java.lang.reflect."
"Constructor</classname>.newInstance(). It is recommended that this "
"constructor be defined with at least <emphasis>package visibility "
"in order for runtime proxy generation to work properly."
msgstr ""
"<literal>Cat besitzt einen \"No-Argument\"-Konstruktor. Alle "
"persistenten Klassen müssen über einen Standard-Konstruktor verfügen (der "
"nicht-öffentlich sein darf) damit Hibernate sie unter Verwendung von "
"<literal>Constructor.newInstance() instantiieren kann. Wir "
"empfehlen dringend den Einsatz eines Standard-Konstruktors, der zumindest "
"<emphasis>Paket-Sichtbarkeit für die Proxy-Generierung zur "
"Runtime in Hibernate besitzt."

#. Tag: title
#: persistent_classes.xml:74
#, fuzzy, no-c-format
msgid "Provide an identifier property"
msgstr "Bereitstellung einer Bezeichner-Property (optional)"

#. Tag: para
#: persistent_classes.xml:77
#, no-c-format
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 ""
"<classname>Cat has a property named id. 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 ""
"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
#, 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 ""
"Wir empfehlen die Deklarierung konsistent benannter Bezeichner-Properties "
"bei den persistenten Klassen. Ein nullbarer (\"nullable\" - d.h. nicht-"
"primitiver) Typ ist ebenfalls zu bevorzugen."

#. Tag: title
#: 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 (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 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 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: title
#: persistent_classes.xml:121
#, no-c-format
msgid "Disabling proxies in <literal>hbm.xml"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:122
#, no-c-format
msgid "<![CDATA[]]>"
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 ""
"If the <literal>final 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"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:140
#, no-c-format
msgid "<![CDATA[]]>"
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 methods as "
"this will again limit the ability to generate <emphasis>proxies "
"from this class. If you want to use a class with <literal>public final-Methoden an den "
"nicht-finalen Klassen zu deklarieren. Wenn Sie eine Klasse mit einer "
"<literal>public final-Methode verwenden wollen, müssen Sie "
"Proxying durch Setzen von <literal>lazy=\"false\" explizit "
"deaktivieren."

#. Tag: title
#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr ""
"Zugriffsberechtigte und Mutatoren für persistente Felder deklarieren "
"(optional)"

#. Tag: para
#: persistent_classes.xml:160
#, fuzzy, no-c-format
msgid ""
"<classname>Cat 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>getFooisFoo and setFoo. If "
"required, you can switch to direct field access for particular properties."
msgstr ""
"<literal>Cat deklariert die Zugriffsberechtigungsmethoden für alle "
"seine persistenten Felder. Viele andere ORM-Tools persistieren "
"Instanzvariablen direkt. Unserer Ansicht nach ist es besser, eine "
"Indirektion zwischen dem relationalen Schema und internen Datenstrukturen "
"der Klasse bereitzustellen. In der Standardeinstellung persistiert Hibernate "
"Properties im JavaBeans-Stil und erkennt Methodennamen in der Form "
"<literal>getFoo, isFoo und setFoo be declared public. Hibernate can "
"persist a property declared with <literal>package, "
"<literal>protected or private visibility as "
"well."
msgstr ""
"Properties müssen <emphasis>nicht als öffentlich deklariert "
"werden - Hibernate kann eine Property als <literal>protected oder "
"<literal>private \"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 "
"identifier property from the superclass, <literal>Cat. For example:"
msgstr ""
"Eine Subklasse muss ebenfalls die ersten und zweiten Regeln berücksichtigen. "
"Sie erbt ihre Bezeichner-Property von der Superklasse <literal>Cat."

#. 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() and hashCode()"
msgstr ""
"Sie müssen die <literal>equals() and hashCode()-"
"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() and hashCode()"
"</literal> methods if you:"
msgstr ""
"Sie müssen die <literal>equals() and hashCode()-"
"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 "
"(the recommended way to represent many-valued associations); <emphasis>and "
"unterzubringen (die empfohlene Art mehrwertige Assoziationen zu "
"repräsentieren) <emphasis>und"

#. 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 "
"Java identity only inside a particular session scope. When you mix instances "
"retrieved in different sessions, you must implement <literal>equals()hashCode() if you wish to have meaningful "
"semantics for <literal>Sets."
msgstr ""
"Hibernate garantiert nur die Äquivalenz der persistenten Identität "
"(Datenbankreihe) und der Java-Identität innerhalb eines bestimmten "
"Gültigkeitsbreichs einer Session. Sobald die Instanzen verschiedener "
"Sessions zusammenkommen, müssen <literal>equals() und "
"<literal>hashCode() implementiert werden, wenn wir uns eine "
"aussagekräftige Semantik für <literal>Sets wünschen."

#. Tag: para
#: persistent_classes.xml:212
#, fuzzy, no-c-format
msgid ""
"The most obvious way is to implement <literal>equals()/"
"<literal>hashCode() 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, you "
"will only have one element in the <literal>Set). 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, saving it will assign an "
"identifier value to the object. If <literal>equals() and "
"<literal>hashCode() are based on the identifier value, the hash "
"code would change, breaking the contract of the <literal>Set. 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 ""
"Die offensichtlichste Weise <literal>equals()/hashCode() hinzugefügt, so existiert lediglich ein Element "
"im <literal>Set). Leider kann diese Vorgehensweise nicht bei "
"generierten Bezeichnern verwendet werden! Hibernate ordnet nur persistenten "
"Objekten Bezeichnerwerte zu, und eine neu erstellte Instanz wird keinen "
"Bezeichnerwert besitzen! Desweiteren wird einer noch ungespeicherten "
"Instanz, die Teil eines <literal>Set ist, bei Speicherung ein "
"Bezeichnerwert zum Objekt zugeordnet. Falls <literal>equals() und "
"<literal>hashCode() auf dem Bezeichnerwert basieren, so würde sich "
"der Hash-Code ändern und dadurch das Interface (sog. \"contract\") des "
"<literal>Set verletzen. Eine ausführliche Darstellung dieses "
"Problems finden Sie auf der Website von Hibernate. Bitte beachten Sie, dass "
"dies nicht auf Hibernate selbst zurückzuführen ist, sondern auf regulärer "
"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() and "
"<literal>hashCode() using Business key equalityequals() "
"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 und "
"<literal>hashCode() unter Verwendung von \"Business Key "
"Equality\"</emphasis>. \"Business Key Equality\" bedeutet, dass die "
"<literal>equals()-Methode nur die Properties, aus denen sich der "
"\"Business Key\" zusammensetzt, miteinander vergleicht. Der Key (Schlüssel) "
"identifiziert Ihre Instanz in der Realität (ein <emphasis>natürlichers of Maps at runtime) "
"and the representation of entities as DOM4J trees. With this approach, you "
"do not write persistent classes, only mapping files."
msgstr ""
"Persistente Entities müssen zur Runtime nicht unbedingt als POJO-Klassen "
"oder JavaBean-Objekte repräsentiert werden. Hibernate unterstützt auch "
"dynamische Modelle (unter Verwendung von <literal>Maps von "
"<literal>Maps zur Runtime) und die Repräsentation von Entities als "
"DOM4J-Trees. Bei dieser Vorgehensweise schreiben Sie keine persistenten "
"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>SessionFactorydefault_entity_mode configuration "
"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 "
"<literal>SessionFactory unter Verwendung der "
"<literal>default_entity_mode-Konfigurationsoption einstellen "
"(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>Mapentity-name has "
"to be declared instead of, or in addition to, a class name:"
msgstr ""
"Das folgende Beispiel stellt die Repräsentation unter Verwendung von "
"<literal>Maps dar. Zuerst muss in der Mapping-Datei ein "
"<literal>entity-name 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 "
"type of associations can also be a dynamic entity instead of a POJO."
msgstr ""
"Bitte bachten Sie, dass der Zieltyp einer Assoziation auch eine dynamische "
"Entity statt POJO sein kann, obwohl Assoziationen unter Verwendung von Ziel-"
"Klassennamen deklariert werden."

#. Tag: para
#: persistent_classes.xml:276
#, fuzzy, no-c-format
msgid ""
"After setting the default entity mode to <literal>dynamic-map for "
"the <literal>SessionFactory, you can, at runtime, work with "
"<literal>Maps of Maps:"
msgstr ""
"Nachdem der Standard für den Entity-Modus auf <literal>dynamic-map "
"für die <literal>SessionFactory gesetzt ist, können wir zur "
"Runtime mit <literal>Maps von Maps 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 "
"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 ""
"Die Vorteile des dynamischen Mappings liegen in der schnellen Durchlaufzeit "
"für Musteranwendungsverfahren (sog. \"Turnaround-Time\" für \"Prototyping\") "
"ohne die Notwendigkeit Entity-Klassen zu implementieren. Sie verlieren "
"jedoch durch die Typ-Prüfung Kompilierungszeit, und es ist wahrscheinlich, "
"dass es bei der Runtime zu zahlreichen Ausnahmemeldungen kommt. Dank des "
"Mappings von Hibernate kann das Datenbankschema bequem vereinheitlicht und "
"stabilisiert werden, so dass eine ordnungsgemäße Implementierung des Domain-"
"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 using an "
"<literal>EntityMode is on the Session API, not "
"the <literal>SessionFactory. That way, the new Sessionclose() on the secondary Session unter "
"Verwendung von  <literal>EntityMode am Session-"
"API und nicht an der <literal>SessionFactory erfolgt. Auf diese "
"Weise teilt sich die <literal>Session die zu Grunde liegende JDBC-"
"Verbindung, die Transaktion und andere Kontextinformationen. Das bedeutet, "
"dass Sie in der sekundären <literal>Session nicht flush()"
"</literal> und close() aufrufen müssen und auch die "
"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\"/>."
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 ""
"<interfacename>org.hibernate.tuple.Tuplizer 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 und seine untergeordneten "
"Schnittstellen sind angesichts des <literal>org.hibernate.EntityMode und "
"<literal>org.hibernate.tuple.component.ComponentTuplizer "
"Interfaces repräsentiert sind. <literal>EntityTuplizers sind für "
"die Verwaltung der oben genannten Schnittstellen hinsichtlich der Entities "
"verantwortlich, während <literal>ComponentTuplizers dasselbe für "
"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 ""
"<interfacename>org.hibernate.tuple.entity.EntityTuplizer "
"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 implementation other than "
"<classname>java.util.HashMap 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 entity,  "
"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
"\"/> shows how to do the same in <literal>hbm.xml"
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 "
"<literal>java.util.Map als java.util.HashMap "
"benötigen oder eine andere Strategie für die Proxy-Generierung definieren "
"müssen als die im Standard vorgegebene. Beide würden durch die Definition "
"einer anwenderdefinierten Tuplizer-Implementierung erzielt. Tuplizer-"
"Definitionen sind der Entity oder dem Komponenten-Mapping hinzugefügt, die "
"sie verwalten sollen. Sehen wir uns noch einmal das Beispiel unserer Kunden-"
"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"
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 ""
"<interfacename>org.hibernate.EntityNameResolver is a "
"contract for resolving the entity name of a given entity instance. The "
"interface defines a single method <methodname>resolveEntityName "
"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. "
"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.EntityNameResolvergetEntityNameResolvers "
"method"
msgstr ""

#. Tag: para
#: persistent_classes.xml:389
#, no-c-format
msgid ""
"Register it with the <classname>org.hibernate.impl.SessionFactoryImplorg."
"hibernate.SessionFactory</interfacename>) using the "
"<methodname>registerEntityNameResolver method."
msgstr ""

#, fuzzy
#~ msgid ""
#~ "Most Java applications require a persistent class representing felines. "
#~ "For example:"
#~ msgstr ""
#~ "Die meisten Java-Anwendungen erfordern eine persistente Klasse, die "
#~ "Katzen (\"felines\") repräsentiert."

#, fuzzy
#~ msgid ""
#~ "<literal>Cat has a property called id. 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 java.util.Date. 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 besitzt eine Property mit Namen id oder 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 ""
#~ "In fact, some functionality is available only to classes that declare an "
#~ "identifier property:"
#~ msgstr ""
#~ "Tatsächlich sind einige Funktionalitäten nur für Klassen mit deklarierter "
#~ "Bezeichner-Property verfügbar:"

#, fuzzy
#~ 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"

#, fuzzy
#~ msgid "<literal>Session.saveOrUpdate()"
#~ msgstr "Session.saveOrUpdate()"

#, fuzzy
#~ msgid "<literal>Session.merge()"
#~ msgstr "Session.merge()"

#~ msgid ""
#~ "A central feature of Hibernate, <emphasis>proxies, depends "
#~ "upon the persistent class being either non-final, or the implementation "
#~ "of an interface that declares all public methods."
#~ msgstr ""
#~ "Ein zentrales Feature von Hibernate, <emphasis>Proxies, hängt "
#~ "davon ab, ob die persistente Klasse entweder nicht-final oder der alle "
#~ "Methoden als öffentlich erklärenden Implemetierung eines Interface."

#, fuzzy
#~ msgid ""
#~ "You can persist <literal>final 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 ""
#~ "Sie können <literal>finale 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 ""
#~ "<![CDATA[

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate persistent_classes.po source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.