📄 example_mappings.po
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2007-10-25 07:47+0000\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n"#. Tag: title#: example_mappings.xml:20#, no-c-formatmsgid "Example: Various Mappings"msgstr "例:いろいろなマッピング"#. Tag: para#: example_mappings.xml:22#, no-c-formatmsgid "This chapters shows off some more complex association mappings."msgstr "この章では、より複雑な関連のマッピングをいくつか紹介します。"#. Tag: title#: example_mappings.xml:27#, no-c-formatmsgid "Employer/Employee"msgstr "雇用者/従業員"#. Tag: para#: example_mappings.xml:29#, no-c-formatmsgid """The following model of the relationship between <literal>Employer</literal> ""and <literal>Employee</literal> uses an actual entity class ""(<literal>Employment</literal>) to represent the association. This is done ""because there might be more than one period of employment for the same two ""parties. Components are used to model monetary values and employee names."msgstr """<literal>Employer</literal> と <literal>Employee</literal> の関係を表す以下の""モデルは、 関連の表現に実際のエンティティクラス( <literal>Employment</""literal> ) を使います。 なぜなら、同じ2つのパーティに複数の期間雇用されると""いうことがありえるからです。 お金の値と従業員の名前をモデル化するためにコン""ポーネントを使っています。"#. Tag: para#: example_mappings.xml:46#, no-c-formatmsgid "Heres a possible mapping document:"msgstr "マッピングドキュメントの一例です:"#. Tag: programlisting#: example_mappings.xml:50#, no-c-formatmsgid """<![CDATA[<hibernate-mapping>\n"" \n"" <class name=\"Employer\" table=\"employers\">\n"" <id name=\"id\">\n"" <generator class=\"sequence\">\n"" <param name=\"sequence\">employer_id_seq</param>\n"" </generator>\n"" </id>\n"" <property name=\"name\"/>\n"" </class>\n""\n"" <class name=\"Employment\" table=\"employment_periods\">\n""\n"" <id name=\"id\">\n"" <generator class=\"sequence\">\n"" <param name=\"sequence\">employment_id_seq</param>\n"" </generator>\n"" </id>\n"" <property name=\"startDate\" column=\"start_date\"/>\n"" <property name=\"endDate\" column=\"end_date\"/>\n""\n"" <component name=\"hourlyRate\" class=\"MonetaryAmount\">\n"" <property name=\"amount\">\n"" <column name=\"hourly_rate\" sql-type=\"NUMERIC(12, 2)\"/>\n"" </property>\n"" <property name=\"currency\" length=\"12\"/>\n"" </component>\n""\n"" <many-to-one name=\"employer\" column=\"employer_id\" not-null=\"true""\"/>\n"" <many-to-one name=\"employee\" column=\"employee_id\" not-null=\"true""\"/>\n""\n"" </class>\n""\n"" <class name=\"Employee\" table=\"employees\">\n"" <id name=\"id\">\n"" <generator class=\"sequence\">\n"" <param name=\"sequence\">employee_id_seq</param>\n"" </generator>\n"" </id>\n"" <property name=\"taxfileNumber\"/>\n"" <component name=\"name\" class=\"Name\">\n"" <property name=\"firstName\"/>\n"" <property name=\"initial\"/>\n"" <property name=\"lastName\"/>\n"" </component>\n"" </class>\n""\n""</hibernate-mapping>]]>"msgstr ""#. Tag: para#: example_mappings.xml:52#, no-c-formatmsgid """And heres the table schema generated by <literal>SchemaExport</literal>."msgstr "<literal>SchemaExport</literal> で生成したテーブルスキーマです。"#. Tag: programlisting#: example_mappings.xml:56#, no-c-formatmsgid """<![CDATA[create table employers (\n"" id BIGINT not null, \n"" name VARCHAR(255), \n"" primary key (id)\n"")\n""\n""create table employment_periods (\n"" id BIGINT not null,\n"" hourly_rate NUMERIC(12, 2),\n"" currency VARCHAR(12), \n"" employee_id BIGINT not null, \n"" employer_id BIGINT not null, \n"" end_date TIMESTAMP, \n"" start_date TIMESTAMP, \n"" primary key (id)\n"")\n""\n""create table employees (\n"" id BIGINT not null, \n"" firstName VARCHAR(255), \n"" initial CHAR(1), \n"" lastName VARCHAR(255), \n"" taxfileNumber VARCHAR(255), \n"" primary key (id)\n"")\n""\n""alter table employment_periods \n"" add constraint employment_periodsFK0 foreign key (employer_id) ""references employers\n""alter table employment_periods \n"" add constraint employment_periodsFK1 foreign key (employee_id) ""references employees\n""create sequence employee_id_seq\n""create sequence employment_id_seq\n""create sequence employer_id_seq]]>"msgstr ""#. Tag: title#: example_mappings.xml:61#, no-c-formatmsgid "Author/Work"msgstr "作者/作品"#. Tag: para#: example_mappings.xml:63#, no-c-formatmsgid """Consider the following model of the relationships between <literal>Work</""literal>, <literal>Author</literal> and <literal>Person</literal>. We ""represent the relationship between <literal>Work</literal> and ""<literal>Author</literal> as a many-to-many association. We choose to ""represent the relationship between <literal>Author</literal> and ""<literal>Person</literal> as one-to-one association. Another possibility ""would be to have <literal>Author</literal> extend <literal>Person</literal>."msgstr """<literal>Work</literal> , <literal>Author</literal> そして <literal>Person</""literal> の関係を表す以下のモデルを考えてみてください。 <literal>Work</""literal> と <literal>Author</literal> の関係を多対多関連で表しています。 ""<literal>Author</literal> と <literal>Person</literal> の関係は一対一関連とし""て表しています。 他には <literal>Author</literal> が <literal>Person</""literal> を拡張するという方法もあります。"#. Tag: para#: example_mappings.xml:81#, no-c-formatmsgid """The following mapping document correctly represents these relationships:"msgstr "以下のマッピングドキュメントはこのような関係を正確に表現しています。"#. Tag: programlisting#: example_mappings.xml:85#, no-c-formatmsgid """<![CDATA[<hibernate-mapping>\n""\n"" <class name=\"Work\" table=\"works\" discriminator-value=\"W\">\n""\n"" <id name=\"id\" column=\"id\">\n"" <generator class=\"native\"/>\n"" </id>\n"" <discriminator column=\"type\" type=\"character\"/>\n""\n"" <property name=\"title\"/>\n"" <set name=\"authors\" table=\"author_work\">\n"" <key column name=\"work_id\"/>\n"" <many-to-many class=\"Author\" column name=\"author_id\"/>\n"" </set>\n""\n"" <subclass name=\"Book\" discriminator-value=\"B\">\n"" <property name=\"text\"/>\n"" </subclass>\n""\n"" <subclass name=\"Song\" discriminator-value=\"S\">\n"" <property name=\"tempo\"/>\n"" <property name=\"genre\"/>\n"" </subclass>\n""\n"" </class>\n""\n"" <class name=\"Author\" table=\"authors\">\n""\n"" <id name=\"id\" column=\"id\">\n"" <!-- The Author must have the same identifier as the Person -->\n"" <generator class=\"assigned\"/> \n"" </id>\n""\n"" <property name=\"alias\"/>\n"" <one-to-one name=\"person\" constrained=\"true\"/>\n""\n"" <set name=\"works\" table=\"author_work\" inverse=\"true\">\n"" <key column=\"author_id\"/>\n"" <many-to-many class=\"Work\" column=\"work_id\"/>\n"" </set>\n""\n"" </class>\n""\n"" <class name=\"Person\" table=\"persons\">\n"" <id name=\"id\" column=\"id\">\n"" <generator class=\"native\"/>\n"" </id>\n"" <property name=\"name\"/>\n"" </class>\n""\n""</hibernate-mapping>]]>"msgstr ""#. Tag: para#: example_mappings.xml:87#, no-c-formatmsgid """There are four tables in this mapping. <literal>works</literal>, ""<literal>authors</literal> and <literal>persons</literal> hold work, author ""and person data respectively. <literal>author_work</literal> is an ""association table linking authors to works. Heres the table schema, as ""generated by <literal>SchemaExport</literal>."msgstr """このマッピングには4つのテーブルがあります。 <literal>works</literal> , ""<literal>authors</literal> , <literal>persons</literal> はそれぞれ、仕事、作""者、人のデータを保持します。 <literal>author_work</literal> は作者と作品をリ""ンクする関連テーブルです。 以下は <literal>SchemaExport</literal> で生成した""テーブルスキーマです。"#. Tag: programlisting#: example_mappings.xml:95#, no-c-formatmsgid """<![CDATA[create table works (\n"" id BIGINT not null generated by default as identity, \n"" tempo FLOAT, \n"" genre VARCHAR(255), \n"" text INTEGER, \n"" title VARCHAR(255), \n"" type CHAR(1) not null, \n"" primary key (id)\n"")\n""\n""create table author_work (\n"" author_id BIGINT not null, \n"" work_id BIGINT not null, \n"" primary key (work_id, author_id)\n"")\n""\n""create table authors (\n"" id BIGINT not null generated by default as identity, \n"" alias VARCHAR(255), \n"" primary key (id)\n"")\n""\n""create table persons (\n"" id BIGINT not null generated by default as identity, \n"" name VARCHAR(255), \n"" primary key (id)\n"")\n""\n""alter table authors \n"" add constraint authorsFK0 foreign key (id) references persons\n""alter table author_work \n"" add constraint author_workFK0 foreign key (author_id) references ""authors\n""alter table author_work\n"" add constraint author_workFK1 foreign key (work_id) references works]]>"msgstr ""#. Tag: title#: example_mappings.xml:100#, no-c-formatmsgid "Customer/Order/Product"msgstr "顧客/注文/製品"#. Tag: para#: example_mappings.xml:102#, no-c-formatmsgid """Now consider a model of the relationships between <literal>Customer</""literal>, <literal>Order</literal> and <literal>LineItem</literal> and ""<literal>Product</literal>. There is a one-to-many association between ""<literal>Customer</literal> and <literal>Order</literal>, but how should we ""represent <literal>Order</literal> / <literal>LineItem</literal> / ""<literal>Product</literal>? I've chosen to map <literal>LineItem</literal> ""as an association class representing the many-to-many association between ""<literal>Order</literal> and <literal>Product</literal>. In Hibernate, this ""is called a composite element."msgstr """さて、 <literal>Customer</literal> , <literal>Order</literal> , ""<literal>LineItem</literal><literal>Product</literal> の関係を表すモデルを考""えてみましょう。 <literal>Customer</literal> と <literal>Order</literal> は一""対多の関連ですが、 <literal>Order</literal> / <literal>LineItem</literal> / ""<literal>Product</literal> はどのように表現するべきでしょうか? ""<literal>LineItem</literal> を、<literal>Order</literal> と ""<literal>Product</literal> の多対多関連を表現する関連クラスとしてマッピングし""ました。 Hibernateではこれをコンポジット要素と呼びます。"#. Tag: para#: example_mappings.xml:122#, no-c-formatmsgid "The mapping document:"msgstr "マッピングドキュメント:"#. Tag: programlisting#: example_mappings.xml:126#, no-c-formatmsgid """<![CDATA[<hibernate-mapping>\n""\n"" <class name=\"Customer\" table=\"customers\">\n"" <id name=\"id\">\n"" <generator class=\"native\"/>\n"" </id>\n"" <property name=\"name\"/>\n"" <set name=\"orders\" inverse=\"true\">\n"" <key column=\"customer_id\"/>\n"" <one-to-many class=\"Order\"/>\n"" </set>\n"" </class>\n""\n"" <class name=\"Order\" table=\"orders\">\n"" <id name=\"id\">\n"" <generator class=\"native\"/>\n"" </id>\n"" <property name=\"date\"/>\n"" <many-to-one name=\"customer\" column=\"customer_id\"/>\n"" <list name=\"lineItems\" table=\"line_items\">\n"" <key column=\"order_id\"/>\n"" <list-index column=\"line_number\"/>\n"" <composite-element class=\"LineItem\">\n"" <property name=\"quantity\"/>\n"" <many-to-one name=\"product\" column=\"product_id\"/>\n"" </composite-element>\n"" </list>\n"" </class>\n""\n"" <class name=\"Product\" table=\"products\">\n"" <id name=\"id\">\n"" <generator class=\"native\"/>\n"" </id>\n"" <property name=\"serialNumber\"/>\n"" </class>\n""\n""</hibernate-mapping>]]>"msgstr ""#. Tag: para#: example_mappings.xml:128#, no-c-formatmsgid """<literal>customers</literal>, <literal>orders</literal>, ""<literal>line_items</literal> and <literal>products</literal> hold customer, ""order, order line item and product data respectively. <literal>line_items</""literal> also acts as an association table linking orders with products."msgstr """<literal>customers</literal> , <literal>orders</literal> , ""<literal>line_items</literal> , <literal>products</literal> はそれぞれ、顧""客、注文、注文明細、製品のデータを保持します。 <literal>line_items</literal> ""は注文と製品をリンクする関連テーブルとしても働きます。"#. Tag: programlisting#: example_mappings.xml:135
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -