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

Hibernate example source code file (xml.po)

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

account, cdata, customer, customer, customer_id, element, element, hibernate, pojo, session, tag, tag, xml, xml

The Hibernate xml.po source code

# translation of Collection_Mapping.po to
# Xi HUANG <xhuang@redhat.com>, 2007, 2010.
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: 2010-01-18 15:42+1000\n"
"Last-Translator: Xi HUANG <xhuang@redhat.com>\n"
"Language-Team:  <en@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.11.4\n"

#. Tag: title
#, no-c-format
msgid "XML Mapping"
msgstr "XML マッピング"

#. Tag: para
#, fuzzy, no-c-format
msgid ""
"<emphasis> XML Mapping is an experimental feature in Hibernate 3.0 and is "
"currently under active development. </emphasis>"
msgstr ""
"XML マッピングは Hibernate3.0 では試験的な機能であり、非常に活動的に開発中で"
"す。"

#. Tag: title
#, no-c-format
msgid "Working with XML data"
msgstr "XML データでの作業"

#. Tag: para
#, no-c-format
msgid ""
"Hibernate allows you to work with persistent XML data in much the same way "
"you work with persistent POJOs. A parsed XML tree can be thought of as "
"another way of representing the relational data at the object level, instead "
"of POJOs."
msgstr ""
"Hibernate では永続性の POJO を使って作業するのとほぼ同じようなやり方で、永続"
"性の XML データを使って作業できます。解析された XML ツリーは POJO の代わりに"
"オブジェクトレベルで関係データを表わす別の方法であるとみなされています。"

#. Tag: para
#, no-c-format
msgid ""
"Hibernate supports dom4j as API for manipulating XML trees. You can write "
"queries that retrieve dom4j trees from the database and have any "
"modification you make to the tree automatically synchronized to the "
"database. You can even take an XML document, parse it using dom4j, and write "
"it to the database with any of Hibernate's basic operations: <literal>persist"
"(), saveOrUpdate(), merge(), delete(), replicate()</literal> (merging is not "
"yet supported)."
msgstr ""
"Hibernate は XML ツリーを操作するための API として dom4j をサポートしていま"
"す。データベースから dom4j のツリーを復元するクエリを書くことができ、ツリーに"
"対して行った修正は自動的にデータベースと同期されます。また XML ドキュメントを"
"取得することができ、 dom4j を使ってドキュメントをパースし、 Hibernate の任意"
"の基本操作を使ってデータベースへ書き込むことができます。: つまり、 "
"<literal>persist(), saveOrUpdate(), merge(), delete(), replicate() "
"操作です (マージはまだサポートしていません)。"

#. Tag: para
#, no-c-format
msgid ""
"This feature has many applications including data import/export, "
"externalization of entity data via JMS or SOAP and XSLT-based reporting."
msgstr ""
"データのインポート/エクスポート、 JMS によるエンティティデータの外部化や "
"SOAP 、 XSLT ベースのレポートなど、この機能には多くの用途があります。"

#. Tag: para
#, no-c-format
msgid ""
"A single mapping can be used to simultaneously map properties of a class and "
"nodes of an XML document to the database, or, if there is no class to map, "
"it can be used to map just the XML."
msgstr ""
"単一のマッピングは、クラスのプロパティと XML ドキュメントのノードを同時にデー"
"タベースへマッピングするために使うことができます。またマッピングするクラスが"
"なければ、 XML だけをマッピングするために使うことができます。"

#. Tag: title
#, no-c-format
msgid "Specifying XML and class mapping together"
msgstr "XML とクラスのマッピングを同時に指定する"

#. Tag: para
#, no-c-format
msgid "Here is an example of mapping a POJO and XML simultaneously:"
msgstr "これは POJO と XML を同時にマッピングする例です:"

#. Tag: title
#, no-c-format
msgid "Specifying only an XML mapping"
msgstr "XML マッピングだけを指定する"

#. Tag: para
#, no-c-format
msgid "Here is an example where there is no POJO class:"
msgstr "これは POJO クラスがないマッピングの例です:"

#. Tag: para
#, no-c-format
msgid ""
"This mapping allows you to access the data as a dom4j tree, or as a graph of "
"property name/value pairs or java <literal>Maps. The property "
"names are purely logical constructs that can be referred to in HQL queries."
msgstr ""
"このマッピングにより、 dom4j ツリーか、プロパティ名/値の組のグラフ(java の "
"<literal>Map)としてデータにアクセスできます。プロパティの名前は、 "
"HQL クエリ内で参照できる純粋な論理構造です。"

#. Tag: title
#, no-c-format
msgid "XML mapping metadata"
msgstr "XML マッピングのメタデータ"

#. Tag: para
#, no-c-format
msgid ""
"A range of Hibernate mapping elements accept the <literal>node "
"attribute. This lets you specify the name of an XML attribute or element "
"that holds the property or entity data. The format of the <literal>node 属性が使用できま"
"す。これにより XML 属性の名前やプロパティやエンティティデータを保持する要素を"
"指定できます。 <literal>node 属性のフォーマットは以下の中の1つでな"
"ければなりません:"

#. Tag: para
#, no-c-format
msgid "<literal>\"element-name\": map to the named XML element"
msgstr ""
"<literal>\"element-name\" - 指定した XML 要素へマッピングします"

#. Tag: para
#, no-c-format
msgid "<literal>\"@attribute-name\": map to the named XML attribute"
msgstr ""
"<literal>\"@attribute-name\" - 指定した XML 属性へマッピングします"

#. Tag: para
#, no-c-format
msgid "<literal>\".\": map to the parent element"
msgstr "<literal>\".\" - 親要素へマッピングします"

#. Tag: para
#, no-c-format
msgid ""
"<literal>\"element-name/@attribute-name\": map to the named "
"attribute of the named element"
msgstr ""
"<literal>\"element-name/@attribute-name\" - 指定したエレメントの指"
"定した属性へマッピングします"

#. Tag: para
#, no-c-format
msgid ""
"For collections and single valued associations, there is an additional "
"<literal>embed-xml attribute. If embed-xml=\"true\", "
"then only the referenced identifier value will appear in the XML for single "
"point associations and collections will not appear at all."
msgstr ""
"コレクションと単一の値の関連に対して、おまけの <literal>embed-xml "
"属性があります。デフォルトの <literal>embed-xml=\"true\" と設定した"
"場合、関連するエンティティ (値型のコレクション) の XML ツリーは、直接関連を所"
"有するエンティティの XML ツリー内に埋め込まれます。反対に、 <literal>embed-"
"xml=\"false\"</literal> と設定した場合、参照される識別子の値だけが多重度1側"
"の関連に対する XML に現れ、単純にコレクションはまったく現れなくなります。"

#. Tag: para
#, no-c-format
msgid ""
"Do not leave <literal>embed-xml=\"true\" for too many "
"associations, since XML does not deal well with circularity."
msgstr ""
"あまりに多くの関連に対して <literal>embed-xml=\"true\" としたままに"
"するのは注意すべきです。 XML は循環をうまく扱えません。"

#. Tag: para
#, no-c-format
msgid ""
"In this case, the collection of account ids is embedded, but not the actual "
"account data. The following HQL query:"
msgstr ""
"この例では、実際の account のデータではなく、 account の id のコレクションを"
"埋め込むことにしました。続きの HQL クエリです:"

#. Tag: para
#, no-c-format
msgid "would return datasets such as this:"
msgstr "このようなデータセットを返すでしょう:"

#. Tag: para
#, no-c-format
msgid ""
"If you set <literal>embed-xml=\"true\" on the <one-to-"
"many></literal> mapping, the data might look more like this:"
msgstr ""
"<literal><one-to-many> マッピングで embed-xml=\"true"
"\"</literal> と設定した場合、データはこのようになるでしょう。"

#. Tag: title
#, no-c-format
msgid "Manipulating XML data"
msgstr "XML データを扱う"

#. Tag: para
#, no-c-format
msgid ""
"You can also re-read and update XML documents in the application. You can do "
"this by obtaining a dom4j session:"
msgstr ""
"XML ドキュメントを、アプリケーション内で再読み込みや更新をしてみましょう。以"
"下では dom4j のセッションを取得することで行います:"

#. Tag: para
#, no-c-format
msgid ""
"When implementing XML-based data import/export, it is useful to combine this "
"feature with Hibernate's <literal>replicate() operation."
msgstr ""
"XML ベースのデータのインポート/エクスポートを実装するために、 Hibernate の "
"<literal>replicate() 操作をこの機能に結びつけるのは極めて有効です。"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<class name=\"Account\" \n"
#~ "        table=\"ACCOUNTS\" \n"
#~ "        node=\"account\">\n"
#~ "        \n"
#~ "    <id name=\"accountId\" \n"
#~ "            column=\"ACCOUNT_ID\" \n"
#~ "            node=\"@id\"/>\n"
#~ "            \n"
#~ "    <many-to-one name=\"customer\" \n"
#~ "            column=\"CUSTOMER_ID\" \n"
#~ "            node=\"customer/@id\" \n"
#~ "            embed-xml=\"false\"/>\n"
#~ "            \n"
#~ "    <property name=\"balance\" \n"
#~ "            column=\"BALANCE\" \n"
#~ "            node=\"balance\"/>\n"
#~ "            \n"
#~ "    ...\n"
#~ "    \n"
#~ "</class>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<class entity-name=\"Account\" \n"
#~ "        table=\"ACCOUNTS\" \n"
#~ "        node=\"account\">\n"
#~ "        \n"
#~ "    <id name=\"id\" \n"
#~ "            column=\"ACCOUNT_ID\" \n"
#~ "            node=\"@id\" \n"
#~ "            type=\"string\"/>\n"
#~ "            \n"
#~ "    <many-to-one name=\"customerId\" \n"
#~ "            column=\"CUSTOMER_ID\" \n"
#~ "            node=\"customer/@id\" \n"
#~ "            embed-xml=\"false\" \n"
#~ "            entity-name=\"Customer\"/>\n"
#~ "            \n"
#~ "    <property name=\"balance\" \n"
#~ "            column=\"BALANCE\" \n"
#~ "            node=\"balance\" \n"
#~ "            type=\"big_decimal\"/>\n"
#~ "            \n"
#~ "    ...\n"
#~ "    \n"
#~ "</class>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<class name=\"Customer\" \n"
#~ "        table=\"CUSTOMER\" \n"
#~ "        node=\"customer\">\n"
#~ "        \n"
#~ "    <id name=\"id\" \n"
#~ "            column=\"CUST_ID\" \n"
#~ "            node=\"@id\"/>\n"
#~ "            \n"
#~ "    <map name=\"accounts\" \n"
#~ "            node=\".\" \n"
#~ "            embed-xml=\"true\">\n"
#~ "        <key column=\"CUSTOMER_ID\" \n"
#~ "                not-null=\"true\"/>\n"
#~ "        <map-key column=\"SHORT_DESC\" \n"
#~ "                node=\"@short-desc\" \n"
#~ "                type=\"string\"/>\n"
#~ "        <one-to-many entity-name=\"Account\"\n"
#~ "                embed-xml=\"false\" \n"
#~ "                node=\"account\"/>\n"
#~ "    </map>\n"
#~ "    \n"
#~ "    <component name=\"name\" \n"
#~ "            node=\"name\">\n"
#~ "        <property name=\"firstName\" \n"
#~ "                node=\"first-name\"/>\n"
#~ "        <property name=\"initial\" \n"
#~ "                node=\"initial\"/>\n"
#~ "        <property name=\"lastName\" \n"
#~ "                node=\"last-name\"/>\n"
#~ "    </component>\n"
#~ "    \n"
#~ "    ...\n"
#~ "    \n"
#~ "</class>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[from Customer c left join fetch c.accounts where c.lastName "
#~ "like :lastName]]>"
#~ msgstr ""
#~ "from Customer c left join fetch c.accounts where c.lastName like :lastName"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[\n"
#~ "    <account short-desc=\"Credit Card\">985612323\n"
#~ "    <name>\n"
#~ "        <first-name>Gavin\n"
#~ "        <initial>A\n"
#~ "        <last-name>King\n"
#~ "    </name>\n"
#~ "    ...\n"
#~ "</customer>]]>"
#~ msgstr ""
#~ "<customer id=\"123456789\">\n"
#~ "    <account short-desc=\"Savings\">987632567</account>\n"
#~ "    <account short-desc=\"Credit Card\">985612323</account>\n"
#~ "    <name>\n"
#~ "        <first-name>Gavin</first-name>\n"
#~ "        <initial>A</initial>\n"
#~ "        <last-name>King</last-name>\n"
#~ "    </name>\n"
#~ "    ...\n"
#~ "</customer>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[\n"
#~ "    </account>\n"
#~ "    <account id=\"985612323\" short-desc=\"Credit Card\">\n"
#~ "        <customer id=\"123456789\"/>\n"
#~ "        <balance>-2370.34\n"
#~ "    </account>\n"
#~ "    <name>\n"
#~ "        <first-name>Gavin\n"
#~ "        <initial>A\n"
#~ "        <last-name>King\n"
#~ "    </name>\n"
#~ "    ...\n"
#~ "</customer>]]>"
#~ msgstr ""
#~ "<customer id=\"123456789\">\n"
#~ "    <account id=\"987632567\" short-desc=\"Savings\">\n"
#~ "        <customer id=\"123456789\"/>\n"
#~ "        <balance>100.29</balance>\n"
#~ "    </account>\n"
#~ "    <account id=\"985612323\" short-desc=\"Credit Card\">\n"
#~ "        <customer id=\"123456789\"/>\n"
#~ "        <balance>-2370.34</balance>\n"
#~ "    </account>\n"
#~ "    <name>\n"
#~ "        <first-name>Gavin</first-name>\n"
#~ "        <initial>A</initial>\n"
#~ "        <last-name>King</last-name>\n"
#~ "    </name>\n"
#~ "    ...\n"
#~ "</customer>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Document doc = ....;\n"
#~ "       \n"
#~ "Session session = factory.openSession();\n"
#~ "Session dom4jSession = session.getSession(EntityMode.DOM4J);\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "\n"
#~ "List results = dom4jSession\n"
#~ "    .createQuery(\"from Customer c left join fetch c.accounts where c."
#~ "lastName like :lastName\")\n"
#~ "    .list();\n"
#~ "for ( int i=0; i<results.size(); i++ ) {\n"
#~ "    //add the customer data to the XML document\n"
#~ "    Element customer = (Element) results.get(i);\n"
#~ "    doc.add(customer);\n"
#~ "}\n"
#~ "\n"
#~ "tx.commit();\n"
#~ "session.close();]]>"
#~ msgstr ""
#~ "Document doc = ....;\n"
#~ "       \n"
#~ "Session session = factory.openSession();\n"
#~ "Session dom4jSession = session.getSession(EntityMode.DOM4J);\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "\n"
#~ "List results = dom4jSession\n"
#~ "    .createQuery(\"from Customer c left join fetch c.accounts where c."
#~ "lastName like :lastName\")\n"
#~ "    .list();\n"
#~ "for ( int i=0; i<results.size(); i++ ) {\n"
#~ "    //add the customer data to the XML document\n"
#~ "    Element customer = (Element) results.get(i);\n"
#~ "    doc.add(customer);\n"
#~ "}\n"
#~ "\n"
#~ "tx.commit();\n"
#~ "session.close();"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[Session session = factory.openSession();\n"
#~ "Session dom4jSession = session.getSession(EntityMode.DOM4J);\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "\n"
#~ "Element cust = (Element) dom4jSession.get(\"Customer\", customerId);\n"
#~ "for ( int i=0; i<results.size(); i++ ) {\n"
#~ "    Element customer = (Element) results.get(i);\n"
#~ "    //change the customer name in the XML and database\n"
#~ "    Element name = customer.element(\"name\");\n"
#~ "    name.element(\"first-name\").setText(firstName);\n"
#~ "    name.element(\"initial\").setText(initial);\n"
#~ "    name.element(\"last-name\").setText(lastName);\n"
#~ "}\n"
#~ "\n"
#~ "tx.commit();\n"
#~ "session.close();]]>"
#~ msgstr ""
#~ "Session session = factory.openSession();\n"
#~ "Session dom4jSession = session.getSession(EntityMode.DOM4J);\n"
#~ "Transaction tx = session.beginTransaction();\n"
#~ "\n"
#~ "Element cust = (Element) dom4jSession.get(\"Customer\", customerId);\n"
#~ "for ( int i=0; i<results.size(); i++ ) {\n"
#~ "    Element customer = (Element) results.get(i);\n"
#~ "    //change the customer name in the XML and database\n"
#~ "    Element name = customer.element(\"name\");\n"
#~ "    name.element(\"first-name\").setText(firstName);\n"
#~ "    name.element(\"initial\").setText(initial);\n"
#~ "    name.element(\"last-name\").setText(lastName);\n"
#~ "}\n"
#~ "\n"
#~ "tx.commit();\n"
#~ "session.close();"

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate xml.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.