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

Hibernate example source code file (example_parentchild.po)

This example Hibernate source code file (example_parentchild.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

cdata, child, child, collection, entity, hibernate, hibernate, in, objekt, parent, parent, tag, tag, the

The Hibernate example_parentchild.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-02-10T07:25:35\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
#, no-c-format
msgid "Example: Parent/Child"
msgstr "Beispiel: \"Parent/Child\""

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"One of the first things that new users want to do with Hibernate is to model "
"a parent/child type relationship. There are two different approaches to "
"this. The most convenient approach, especially for new users, is to model "
"both <literal>Parent and Child as entity "
"classes with a <literal><one-to-many> association from "
"<literal>Parent to Child. The alternative "
"approach is to declare the <literal>Child as a <"
"composite-element></literal>. The default semantics of a one-to-many "
"association in Hibernate are much less close to the usual semantics of a "
"parent/child relationship than those of a composite element mapping. We will "
"explain how to use a <emphasis>bidirectional one-to-many association with "
"cascades</emphasis> to model a parent/child relationship efficiently and "
"elegantly."
msgstr ""
"Eine der ersten Sachen, die neue Benutzer mit Hibernate versuchen, ist es "
"eine Beziehung nach \"Parent\"/\"Child\"-Typ zu bilden. Es gibt dabei zwei "
"verschiedene Herangehensweisen. Aus verschiedenen Gründen empfiehlt es sich "
"gerade für neue Benutzer sowohl <literal>Parent als auch "
"<literal>Child als Entity-Klassen mit einer <one-to-"
"many></literal>-Assoziation von Parent zu "
"<literal>Child zu modellieren. (Alternativ kann das "
"<literal>Child als ein <composite-element> "
"association from <literal>Parent to Child."
msgstr ""
"Gehen wir einmal davon aus, wir wollten mit einer einfachen <literal><one-"
"to-many></literal>-Assoziation von Parent zu "
"<literal>Child beginnen."

#. Tag: para
#, fuzzy, no-c-format
msgid "If we were to execute the following code:"
msgstr "Würden wir den folgenden Code ausführen"

#. Tag: para
#, no-c-format
msgid "Hibernate would issue two SQL statements:"
msgstr "so würde Hibernate zwei SQL-Anweisungen herausgeben:"

#. Tag: para
#, no-c-format
msgid ""
"an <literal>INSERT to create the record for c"
msgstr ""
"ein <literal>INSERT, um den Datensatz für c zu "
"erstellen"

#. Tag: para
#, no-c-format
msgid ""
"an <literal>UPDATE to create the link from p to "
"<literal>c"
msgstr ""
"ein <literal>UPDATE, um die Verbindung von p "
"zu<literal>c zu erstellen"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"This is not only inefficient, but also violates any <literal>NOT NULLparent_id column. You can fix "
"the nullability constraint violation by specifying <literal>not-null=\"true"
"\"</literal> in the collection mapping:"
msgstr ""
"Das ist nicht nur ineffizient, sondern verletzt auch jedwede <literal>NOT "
"NULL</literal>-Bedingung an der parent_id-Spalte. Die "
"Verletzung der \"Nullability\"-Bedingung lässt sich durch das Setzen von "
"<literal>not-null=\"true\" im Collection-Mapping lösen:"

#. Tag: para
#, no-c-format
msgid "However, this is not the recommended solution."
msgstr "Dieses ist jedoch nicht die empfohlene Lösung:"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"The underlying cause of this behavior is that the link (the foreign key "
"<literal>parent_id) from p to cChild "
"object and is therefore not created in the <literal>INSERT. The "
"solution is to make the link part of the <literal>Child mapping."
msgstr ""
"Die zu Grunde liegende Ursache für dieses Verhalten besteht darin, dass das "
"Link (der Fremdschlüssel <literal>parent_id) von pc nicht als Teil des Status des "
"<literal>Child-Objekts angesehen wird und daher nicht im "
"<literal>INSERT erstellt werden kann. Die Lösung besteht also "
"darin, das Link zu einem Teil des <literal>Child-Mappings zu "
"machen."

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"You also need to add the <literal>parent property to the "
"<literal>Child class."
msgstr ""
"(Wir werden außerdem die <literal>parent-Property zur "
"<literal>Child-Klasse hinzufügen müssen)."

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"Now that the <literal>Child entity is managing the state of the "
"link, we tell the collection not to update the link. We use the "
"<literal>inverse attribute to do this:"
msgstr ""
"Da nun die <literal>Child-Entity den Status der Verbindung managt, "
"muss die Collection die Verbindung nicht mehr aktualisieren. Um der "
"Collection dies mitzuteilen verwenden wir das <literal>inverse-"
"Attribut."

#. Tag: para
#, fuzzy, no-c-format
msgid "The following code would be used to add a new <literal>Child:"
msgstr ""
"Der folgende Code würde verwendet, um ein neues <literal>Child "
"hinzuzufügen"

#. Tag: para
#, fuzzy, no-c-format
msgid "Only one SQL <literal>INSERT would now be issued."
msgstr "Und jetzt würde nur ein SQL <literal>INSERT herausgegeben!"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"You could also create an <literal>addChild() method of "
"<literal>Parent."
msgstr ""
"Um das Ganze etwas kompakter zu gestalten würden wir eine <literal>addChild()"
"</literal>-Method von Parent erstellen."

#. Tag: para
#, fuzzy, no-c-format
msgid "The code to add a <literal>Child looks like this:"
msgstr ""
"Nun sieht der Code für das Hinzufügen eines <literal>Child wie "
"folgt aus"

#. Tag: title
#, fuzzy, no-c-format
msgid "Cascading life cycle"
msgstr "Lebenszyklus der Weitergabe (\"Cascading\")"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"You can address the frustrations of the explicit call to <literal>save() ist nach wie vor nicht ideal. "
"Wir gehen dieses Problem mittels Kaskade (sog. \"Cascades\") an."

#. Tag: para
#, fuzzy, no-c-format
msgid "This simplifies the code above to:"
msgstr "Dies vereinfacht den vorherigen Code zu"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"Similarly, we do not need to iterate over the children when saving or "
"deleting a <literal>Parent. The following removes p speichern oder "
"löschen. Nachfolgendes entfernt <literal>p und sämtliche von "
"dessen untergeordneten Objekten aus der Datenbank."

#. Tag: para
#, fuzzy, no-c-format
msgid "However, the following code:"
msgstr "Dieser Code jedoch"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"will not remove <literal>c from the database. In this case, it "
"will only remove the link to <literal>p and cause a NOT "
"NULL</literal> constraint violation. You need to explicitly delete()"
"</literal> the Child."
msgstr ""
"entfernt <literal>c nicht aus der Datenbank; lediglich die "
"Verbindung zu <literal>p wird gelöst (und eine Verletzung der "
"<literal>NOT NULL-Bedingung erfolgt in diesem Fall). Sie müssen "
"für das <literal>Child explizit delete() "
"festlegen."

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"In our case, a <literal>Child cannot exist without its parent. So "
"if we remove a <literal>Child from the collection, we do want it "
"to be deleted. To do this, we must use <literal>cascade=\"all-delete-orphan"
"\"</literal>."
msgstr ""
"In unserem Fall kann jedoch ein <literal>Child ohne den "
"übergeordneten \"Parent\" eigentlich nicht existieren. Wenn wir also ein "
"<literal>Child aus der Collection entfernen, so wollen wir dieses "
"tatsächlich löschen. Dafür müssen wir  <literal>cascade=\"all-delete-orphan"
"\"</literal> verwenden."

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"Even though the collection mapping specifies <literal>inverse=\"true\""
msgstr "Kaskaden und ungespeicherter Wert"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"Suppose we loaded up a <literal>Parent in one Session. The "
"<literal>Parent will contain a collection of children and, since "
"the cascading update is enabled, Hibernate needs to know which children are "
"newly instantiated and which represent existing rows in the database. We "
"will also assume that both <literal>Parent and ChildLongIn Hibernate3, it is no longer "
"necessary to specify an <literal>unsaved-value explicitly. in "
"einer <literal>Session hochgeladen, einige Änderungen in einer UI-"
"Aktion vorgenommen und wollten diese Änderungen in einer neuen Session durch "
"Aufruf von <literal>update() persistieren. Der ParentChild generierte Bezeichner-Properties "
"des Typs <literal>Long besitzen. Hibernate wird den Bezeichner und "
"den Property-Wert von Version/Zeitstempel verwenden, um zu bestimmen, welche "
"der \"Children\" neu sind. (Siehe <xref linkend=\"objectstate-saveorupdate\"/"
">). <emphasis>In Hibernate3 ist es nicht mehr notwendig, explizit einen "
"<literal>unsaved-value festzulegen."

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"The following code will update <literal>parent and childnewChild:"
msgstr ""
"Der folgende Code aktualisiert <literal>parent und childnewChild hinzu."

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"This may be suitable for the case of a generated identifier, but what about "
"assigned identifiers and composite identifiers? This is more difficult, "
"since Hibernate cannot use the identifier property to distinguish between a "
"newly instantiated object, with an identifier assigned by the user, and an "
"object loaded in a previous session. In this case, Hibernate will either use "
"the timestamp or version property, or will actually query the second-level "
"cache or, worst case, the database, to see if the row exists."
msgstr ""
"Nun, all das funktioniert hervorragend im Falle eines generierten "
"Bezeichners, aber was ist mit zugeordneten Bezeichnern und zusammengesetzten "
"Bezeichnern? Das ist schwieriger, da Hibernate hier nicht die Bezeichner-"
"Property zur Unterscheidung zwischen einem neu instantiierten Objekt (mit "
"einem durch den Benutzer zugeordneten Bezeichner) und einem in einer "
"früheren Session geladenen Objekt verwenden kann. In diesem Fall verwendet "
"Hibernate entweder den Zeitstempel oder die Versions-Property oder fragt "
"beim Speicher der zweiten Ebene an. Schlimmstenfalls prüft es in der "
"Datenbank, ob die Reihe existiert."

#. Tag: title
#, no-c-format
msgid "Conclusion"
msgstr "Zusammenfassung"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"The sections we have just covered can be a bit confusing. However, in "
"practice, it all works out nicely. Most Hibernate applications use the "
"parent/child pattern in many places."
msgstr ""
"Das sind eine Menge an Informationen, die zu Beginn vielleicht etwas "
"verwirrend erscheinen. In der Praxis jedoch funktioniert das alles sehr gut. "
"Die meisten Hibernate-Anwendungen verwenden die \"Parent/Child\"-Vorlage bei "
"vielen Gelegenheiten."

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"We mentioned an alternative in the first paragraph. None of the above issues "
"exist in the case of <literal><composite-element> mappings, "
"which have exactly the semantics of a parent/child relationship. "
"Unfortunately, there are two big limitations with composite element classes: "
"composite elements cannot own collections and they should not be the child "
"of any entity other than the unique parent."
msgstr ""
"Im ersten Abschnitt haben wir eine Alternative erwähnt. Keines der gennaten "
"Probleme existiert im Fall von <literal><composite-element>-"
"Mappings, die dieselbe Semantik wie eine \"Parent/Child\"-Beziehung "
"besitzen. Leider bestehen zwei große Einschränkungen bei zusammengesetzten "
"Elementklassen: Zusammengesetzte Elemente können keine Collections besitzen "
"und sie sollten nicht das untergeordnete Objekt (\"Child\") irgendeiner "
"Entity außer dem eindeutigen, übergeordneten Objekt (\"Parent\") sein."

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<set name=\"children\">\n"
#~ "    <key column=\"parent_id\"/>\n"
#~ "    <one-to-many class=\"Child\"/>\n"
#~ "</set>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Parent p = .....;\n"
#~ "Child c = new Child();\n"
#~ "p.getChildren().add(c);\n"
#~ "session.save(c);\n"
#~ "session.flush();]]>"
#~ msgstr ""
#~ "Parent p = .....;\n"
#~ "Child c = new Child();\n"
#~ "p.getChildren().add(c);\n"
#~ "session.save(c);\n"
#~ "session.flush();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<set name=\"children\">\n"
#~ "    <key column=\"parent_id\" not-null=\"true\"/>\n"
#~ "    <one-to-many class=\"Child\"/>\n"
#~ "</set>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<many-to-one name=\"parent\" column=\"parent_id\" not-null=\"true\"/"
#~ ">"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<set name=\"children\" inverse=\"true\">\n"
#~ "    <key column=\"parent_id\"/>\n"
#~ "    <one-to-many class=\"Child\"/>\n"
#~ "</set>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n"
#~ "c.setParent(p);\n"
#~ "p.getChildren().add(c);\n"
#~ "session.save(c);\n"
#~ "session.flush();]]>"
#~ msgstr ""
#~ "Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n"
#~ "c.setParent(p);\n"
#~ "p.getChildren().add(c);\n"
#~ "session.save(c);\n"
#~ "session.flush();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[public void addChild(Child c) {\n"
#~ "    c.setParent(this);\n"
#~ "    children.add(c);\n"
#~ "}]]>"
#~ msgstr ""
#~ "public void addChild(Child c) {\n"
#~ "    c.setParent(this);\n"
#~ "    children.add(c);\n"
#~ "}"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n"
#~ "p.addChild(c);\n"
#~ "session.save(c);\n"
#~ "session.flush();]]>"
#~ msgstr ""
#~ "Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n"
#~ "p.addChild(c);\n"
#~ "session.save(c);\n"
#~ "session.flush();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<set name=\"children\" inverse=\"true\" cascade=\"all\">\n"
#~ "    <key column=\"parent_id\"/>\n"
#~ "    <one-to-many class=\"Child\"/>\n"
#~ "</set>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n"
#~ "p.addChild(c);\n"
#~ "session.flush();]]>"
#~ msgstr ""
#~ "Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = new Child();\n"
#~ "p.addChild(c);\n"
#~ "session.flush();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "session.delete(p);\n"
#~ "session.flush();]]>"
#~ msgstr ""
#~ "Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "session.delete(p);\n"
#~ "session.flush();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = (Child) p.getChildren().iterator().next();\n"
#~ "p.getChildren().remove(c);\n"
#~ "c.setParent(null);\n"
#~ "session.flush();]]>"
#~ msgstr ""
#~ "Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = (Child) p.getChildren().iterator().next();\n"
#~ "p.getChildren().remove(c);\n"
#~ "c.setParent(null);\n"
#~ "session.flush();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = (Child) p.getChildren().iterator().next();\n"
#~ "p.getChildren().remove(c);\n"
#~ "session.delete(c);\n"
#~ "session.flush();]]>"
#~ msgstr ""
#~ "Parent p = (Parent) session.load(Parent.class, pid);\n"
#~ "Child c = (Child) p.getChildren().iterator().next();\n"
#~ "p.getChildren().remove(c);\n"
#~ "session.delete(c);\n"
#~ "session.flush();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<set name=\"children\" inverse=\"true\" cascade=\"all-delete-orphan"
#~ "\">\n"
#~ "    <key column=\"parent_id\"/>\n"
#~ "    <one-to-many class=\"Child\"/>\n"
#~ "</set>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[//parent and child were both loaded in a previous session\n"
#~ "parent.addChild(child);\n"
#~ "Child newChild = new Child();\n"
#~ "parent.addChild(newChild);\n"
#~ "session.update(parent);\n"
#~ "session.flush();]]>"
#~ msgstr ""
#~ "//parent and child were both loaded in a previous session\n"
#~ "parent.addChild(child);\n"
#~ "Child newChild = new Child();\n"
#~ "parent.addChild(newChild);\n"
#~ "session.update(parent);\n"
#~ "session.flush();"

Other Hibernate examples (source code examples)

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

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.