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

Hibernate example source code file (example_mappings.po)

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

author, bigint, bigint, cdata, lineitem, lineitem, order, person, product, tag, tag, timestamp, varchar, varchar

The Hibernate example_mappings.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-20 15:40+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 "Example: Various Mappings"
msgstr "例: いろいろなマッピング"

#. Tag: para
#, no-c-format
msgid "This chapters explores some more complex association mappings."
msgstr "この章では、より複雑な関連のマッピングをいくつか紹介します。"

#. Tag: title
#, no-c-format
msgid "Employer/Employee"
msgstr "雇用者/従業員"

#. Tag: para
#, no-c-format
msgid ""
"The following model of the relationship between <literal>Employer "
"and <literal>Employee uses an entity class (EmploymentEmployee の関係を表す以下の"
"モデルは、関連の表現に実際のエンティティクラス ( <literal>Employment."
msgstr "<literal>SchemaExport で生成したテーブルスキーマです。"

#. Tag: title
#, no-c-format
msgid "Author/Work"
msgstr "作者/作品"

#. Tag: para
#, no-c-format
msgid ""
"Consider the following model of the relationships between <literal>WorkAuthor and Person. In the "
"example, the relationship between <literal>Work and "
"<literal>Author is represented as a many-to-many association and "
"the relationship between <literal>Author and Person extend Person."
msgstr ""
"<literal>WorkAuthor そして PersonWorkAuthor の関係を多対多関連で表しています。 "
"<literal>Author と Person の関係は一対一関連とし"
"て表しています。他には <literal>Author が Person, "
"<literal>authors and persons hold work, author "
"and person data respectively. <literal>author_work is an "
"association table linking authors to works. Here is the table schema, as "
"generated by <literal>SchemaExport:"
msgstr ""
"このマッピングには4つのテーブルがあります。 <literal>works 、 "
"<literal>authors , persons はそれぞれ、仕事、作"
"者、人のデータを保持します。 <literal>author_work は作者と作品をリ"
"ンクする関連テーブルです。以下は <literal>SchemaExport で生成した"
"テーブルスキーマです。"

#. Tag: title
#, no-c-format
msgid "Customer/Order/Product"
msgstr "顧客/注文/製品"

#. Tag: para
#, no-c-format
msgid ""
"In this section we consider a model of the relationships between "
"<literal>Customer, Order, Line ItemProduct. There is a one-to-many association "
"between <literal>Customer and Order, but how "
"can you represent <literal>Order / LineItem / "
"<literal>Product? In the example, LineItem is "
"mapped as an association class representing the many-to-many association "
"between <literal>Order and Product. In "
"Hibernate this is called a composite element."
msgstr ""
"さて、 <literal>Customer 、 Order 、 "
"<literal>LineItem 、 Product の関係を表すモデル"
"を考えてみましょう。 <literal>Customer と Order "
"は一対多の関連ですが、 <literal>Order / LineItemProduct はどのように表現するべきでしょうか? "
"<literal>LineItem を、 Order と "
"<literal>Product の多対多関連を表現する関連クラスとしてマッピングし"
"ました。 Hibernate ではこれをコンポジット要素と呼びます。"

#. Tag: para
#, no-c-format
msgid "The mapping document will look like this:"
msgstr "マッピングドキュメント:"

#. Tag: para
#, no-c-format
msgid ""
"<literal>customers, orders, "
"<literal>line_items and products hold customer, "
"order, order line item and product data respectively. <literal>line_itemsorders 、 "
"<literal>line_items 、 products はそれぞれ、顧"
"客、注文、注文明細、製品のデータを保持します。 <literal>line_items "
"は注文と製品をリンクする関連テーブルとしても働きます。"

#. Tag: title
#, no-c-format
msgid "Miscellaneous example mappings"
msgstr "種々雑多なマッピング例"

#. Tag: para
#, no-c-format
msgid ""
"These examples are available from the Hibernate test suite. You will find "
"many other useful example mappings there by searching in the <literal>test フォルダを見てください。"

#. Tag: title
#, no-c-format
msgid "\"Typed\" one-to-one association"
msgstr "「型付けされた」一対一関連"

#. Tag: title
#, no-c-format
msgid "Composite key example"
msgstr "複合キーの例"

#. Tag: title
#, no-c-format
msgid "Many-to-many with shared composite key attribute"
msgstr "複合キー属性を共有する多対多"

#. Tag: title
#, no-c-format
msgid "Content based discrimination"
msgstr "discrimination に基づく内容"

#. Tag: title
#, no-c-format
msgid "Associations on alternate keys"
msgstr "代替キーの関連"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[\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\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\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 ""
#~ "<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>"

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

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<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>"

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

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<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>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[create table customers (\n"
#~ "    id BIGINT not null generated by default as identity, \n"
#~ "    name VARCHAR(255), \n"
#~ "    primary key (id)\n"
#~ ")\n"
#~ "\n"
#~ "create table orders (\n"
#~ "    id BIGINT not null generated by default as identity, \n"
#~ "    customer_id BIGINT, \n"
#~ "    date TIMESTAMP, \n"
#~ "    primary key (id)\n"
#~ ")\n"
#~ "\n"
#~ "create table line_items (\n"
#~ "    line_number INTEGER not null, \n"
#~ "    order_id BIGINT not null, \n"
#~ "    product_id BIGINT, \n"
#~ "    quantity INTEGER, \n"
#~ "    primary key (order_id, line_number)\n"
#~ ")\n"
#~ "\n"
#~ "create table products (\n"
#~ "    id BIGINT not null generated by default as identity, \n"
#~ "    serialNumber VARCHAR(255), \n"
#~ "    primary key (id)\n"
#~ ")\n"
#~ "\n"
#~ "alter table orders \n"
#~ "    add constraint ordersFK0 foreign key (customer_id) references "
#~ "customers\n"
#~ "alter table line_items\n"
#~ "    add constraint line_itemsFK0 foreign key (product_id) references "
#~ "products\n"
#~ "alter table line_items\n"
#~ "    add constraint line_itemsFK1 foreign key (order_id) references "
#~ "orders]]>"
#~ msgstr ""
#~ "create table customers (\n"
#~ "    id BIGINT not null generated by default as identity, \n"
#~ "    name VARCHAR(255), \n"
#~ "    primary key (id)\n"
#~ ")\n"
#~ "\n"
#~ "create table orders (\n"
#~ "    id BIGINT not null generated by default as identity, \n"
#~ "    customer_id BIGINT, \n"
#~ "    date TIMESTAMP, \n"
#~ "    primary key (id)\n"
#~ ")\n"
#~ "\n"
#~ "create table line_items (\n"
#~ "    line_number INTEGER not null, \n"
#~ "    order_id BIGINT not null, \n"
#~ "    product_id BIGINT, \n"
#~ "    quantity INTEGER, \n"
#~ "    primary key (order_id, line_number)\n"
#~ ")\n"
#~ "\n"
#~ "create table products (\n"
#~ "    id BIGINT not null generated by default as identity, \n"
#~ "    serialNumber VARCHAR(255), \n"
#~ "    primary key (id)\n"
#~ ")\n"
#~ "\n"
#~ "alter table orders \n"
#~ "    add constraint ordersFK0 foreign key (customer_id) references "
#~ "customers\n"
#~ "alter table line_items\n"
#~ "    add constraint line_itemsFK0 foreign key (product_id) references "
#~ "products\n"
#~ "alter table line_items\n"
#~ "    add constraint line_itemsFK1 foreign key (order_id) references orders"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[\n"
#~ "        <formula>'HOME'\n"
#~ "    </one-to-one>\n"
#~ "    <one-to-one name=\"mailingAddress\" \n"
#~ "            cascade=\"all\">\n"
#~ "        <formula>name\n"
#~ "        <formula>'MAILING'\n"
#~ "    </one-to-one>\n"
#~ "</class>\n"
#~ "\n"
#~ "<class name=\"Address\" batch-size=\"2\" \n"
#~ "        check=\"addressType in ('MAILING', 'HOME', 'BUSINESS')\">\n"
#~ "    <composite-id>\n"
#~ "        <key-many-to-one name=\"person\" \n"
#~ "                column=\"personName\"/>\n"
#~ "        <key-property name=\"type\" \n"
#~ "                column=\"addressType\"/>\n"
#~ "    </composite-id>\n"
#~ "    <property name=\"street\" type=\"text\"/>\n"
#~ "    <property name=\"state\"/>\n"
#~ "    <property name=\"zip\"/>\n"
#~ "</class>]]>"
#~ msgstr ""
#~ "<class name=\"Person\">\n"
#~ "    <id name=\"name\"/>\n"
#~ "    <one-to-one name=\"address\" \n"
#~ "            cascade=\"all\">\n"
#~ "        <formula>name</formula>\n"
#~ "        <formula>'HOME'</formula>\n"
#~ "    </one-to-one>\n"
#~ "    <one-to-one name=\"mailingAddress\" \n"
#~ "            cascade=\"all\">\n"
#~ "        <formula>name</formula>\n"
#~ "        <formula>'MAILING'</formula>\n"
#~ "    </one-to-one>\n"
#~ "</class>\n"
#~ "\n"
#~ "<class name=\"Address\" batch-size=\"2\" \n"
#~ "        check=\"addressType in ('MAILING', 'HOME', 'BUSINESS')\">\n"
#~ "    <composite-id>\n"
#~ "        <key-many-to-one name=\"person\" \n"
#~ "                column=\"personName\"/>\n"
#~ "        <key-property name=\"type\" \n"
#~ "                column=\"addressType\"/>\n"
#~ "    </composite-id>\n"
#~ "    <property name=\"street\" type=\"text\"/>\n"
#~ "    <property name=\"state\"/>\n"
#~ "    <property name=\"zip\"/>\n"
#~ "</class>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<class name=\"Customer\">\n"
#~ "\n"
#~ "    <id name=\"customerId\"\n"
#~ "        length=\"10\">\n"
#~ "        <generator class=\"assigned\"/>\n"
#~ "    </id>\n"
#~ "\n"
#~ "    <property name=\"name\" not-null=\"true\" length=\"100\"/>\n"
#~ "    <property name=\"address\" not-null=\"true\" length=\"200\"/>\n"
#~ "\n"
#~ "    <list name=\"orders\"\n"
#~ "            inverse=\"true\"\n"
#~ "            cascade=\"save-update\">\n"
#~ "        <key column=\"customerId\"/>\n"
#~ "        <index column=\"orderNumber\"/>\n"
#~ "        <one-to-many class=\"Order\"/>\n"
#~ "    </list>\n"
#~ "\n"
#~ "</class>\n"
#~ "\n"
#~ "<class name=\"Order\" table=\"CustomerOrder\" lazy=\"true\">\n"
#~ "    <synchronize table=\"LineItem\"/>\n"
#~ "    <synchronize table=\"Product\"/>\n"
#~ "    \n"
#~ "    <composite-id name=\"id\" \n"
#~ "            class=\"Order$Id\">\n"
#~ "        <key-property name=\"customerId\" length=\"10\"/>\n"
#~ "        <key-property name=\"orderNumber\"/>\n"
#~ "    </composite-id>\n"
#~ "    \n"
#~ "    <property name=\"orderDate\" \n"
#~ "            type=\"calendar_date\"\n"
#~ "            not-null=\"true\"/>\n"
#~ "    \n"
#~ "    <property name=\"total\">\n"
#~ "        <formula>\n"
#~ "            ( select sum(li.quantity*p.price) \n"
#~ "            from LineItem li, Product p \n"
#~ "            where li.productId = p.productId \n"
#~ "                and li.customerId = customerId \n"
#~ "                and li.orderNumber = orderNumber )\n"
#~ "        </formula>\n"
#~ "    </property>\n"
#~ "    \n"
#~ "    <many-to-one name=\"customer\"\n"
#~ "            column=\"customerId\"\n"
#~ "            insert=\"false\"\n"
#~ "            update=\"false\" \n"
#~ "            not-null=\"true\"/>\n"
#~ "        \n"
#~ "    <bag name=\"lineItems\"\n"
#~ "            fetch=\"join\" \n"
#~ "            inverse=\"true\"\n"
#~ "            cascade=\"save-update\">\n"
#~ "        <key>\n"
#~ "            <column name=\"customerId\"/>\n"
#~ "            <column name=\"orderNumber\"/>\n"
#~ "        </key>\n"
#~ "        <one-to-many class=\"LineItem\"/>\n"
#~ "    </bag>\n"
#~ "    \n"
#~ "</class>\n"
#~ "    \n"
#~ "<class name=\"LineItem\">\n"
#~ "    \n"
#~ "    <composite-id name=\"id\" \n"
#~ "            class=\"LineItem$Id\">\n"
#~ "        <key-property name=\"customerId\" length=\"10\"/>\n"
#~ "        <key-property name=\"orderNumber\"/>\n"
#~ "        <key-property name=\"productId\" length=\"10\"/>\n"
#~ "    </composite-id>\n"
#~ "    \n"
#~ "    <property name=\"quantity\"/>\n"
#~ "    \n"
#~ "    <many-to-one name=\"order\"\n"
#~ "            insert=\"false\"\n"
#~ "            update=\"false\" \n"
#~ "            not-null=\"true\">\n"
#~ "        <column name=\"customerId\"/>\n"
#~ "        <column name=\"orderNumber\"/>\n"
#~ "    </many-to-one>\n"
#~ "    \n"
#~ "    <many-to-one name=\"product\"\n"
#~ "            insert=\"false\"\n"
#~ "            update=\"false\" \n"
#~ "            not-null=\"true\"\n"
#~ "            column=\"productId\"/>\n"
#~ "        \n"
#~ "</class>\n"
#~ "\n"
#~ "<class name=\"Product\">\n"
#~ "    <synchronize table=\"LineItem\"/>\n"
#~ "\n"
#~ "    <id name=\"productId\"\n"
#~ "        length=\"10\">\n"
#~ "        <generator class=\"assigned\"/>\n"
#~ "    </id>\n"
#~ "    \n"
#~ "    <property name=\"description\" \n"
#~ "        not-null=\"true\" \n"
#~ "        length=\"200\"/>\n"
#~ "    <property name=\"price\" length=\"3\"/>\n"
#~ "    <property name=\"numberAvailable\"/>\n"
#~ "    \n"
#~ "    <property name=\"numberOrdered\">\n"
#~ "        <formula>\n"
#~ "            ( select sum(li.quantity) \n"
#~ "            from LineItem li \n"
#~ "            where li.productId = productId )\n"
#~ "        </formula>\n"
#~ "    </property>\n"
#~ "    \n"
#~ "</class>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA[\n"
#~ "        </many-to-many>\n"
#~ "    </set>\n"
#~ "</class>\n"
#~ "    \n"
#~ "<class name=\"Group\" table=\"`Group`\">\n"
#~ "    <composite-id>\n"
#~ "        <key-property name=\"name\"/>\n"
#~ "        <key-property name=\"org\"/>\n"
#~ "    </composite-id>\n"
#~ "    <property name=\"description\"/>\n"
#~ "    <set name=\"users\" table=\"UserGroup\" inverse=\"true\">\n"
#~ "        <key>\n"
#~ "            <column name=\"groupName\"/>\n"
#~ "            <column name=\"org\"/>\n"
#~ "        </key>\n"
#~ "        <many-to-many class=\"User\">\n"
#~ "            <column name=\"userName\"/>\n"
#~ "            <formula>org\n"
#~ "        </many-to-many>\n"
#~ "    </set>\n"
#~ "</class>\n"
#~ "]]>"
#~ msgstr ""
#~ "<class name=\"User\" table=\"`User`\">\n"
#~ "    <composite-id>\n"
#~ "        <key-property name=\"name\"/>\n"
#~ "        <key-property name=\"org\"/>\n"
#~ "    </composite-id>\n"
#~ "    <set name=\"groups\" table=\"UserGroup\">\n"
#~ "        <key>\n"
#~ "            <column name=\"userName\"/>\n"
#~ "            <column name=\"org\"/>\n"
#~ "        </key>\n"
#~ "        <many-to-many class=\"Group\">\n"
#~ "            <column name=\"groupName\"/>\n"
#~ "            <formula>org</formula>\n"
#~ "        </many-to-many>\n"
#~ "    </set>\n"
#~ "</class>\n"
#~ "    \n"
#~ "<class name=\"Group\" table=\"`Group`\">\n"
#~ "    <composite-id>\n"
#~ "        <key-property name=\"name\"/>\n"
#~ "        <key-property name=\"org\"/>\n"
#~ "    </composite-id>\n"
#~ "    <property name=\"description\"/>\n"
#~ "    <set name=\"users\" table=\"UserGroup\" inverse=\"true\">\n"
#~ "        <key>\n"
#~ "            <column name=\"groupName\"/>\n"
#~ "            <column name=\"org\"/>\n"
#~ "        </key>\n"
#~ "        <many-to-many class=\"User\">\n"
#~ "            <column name=\"userName\"/>\n"
#~ "            <formula>org</formula>\n"
#~ "        </many-to-many>\n"
#~ "    </set>\n"
#~ "</class>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<class name=\"Person\"\n"
#~ "    discriminator-value=\"P\">\n"
#~ "    \n"
#~ "    <id name=\"id\" \n"
#~ "        column=\"person_id\" \n"
#~ "        unsaved-value=\"0\">\n"
#~ "        <generator class=\"native\"/>\n"
#~ "    </id>\n"
#~ "    \n"
#~ "            \n"
#~ "    <discriminator \n"
#~ "        type=\"character\">\n"
#~ "        <formula>\n"
#~ "            case \n"
#~ "                when title is not null then 'E' \n"
#~ "                when salesperson is not null then 'C' \n"
#~ "                else 'P' \n"
#~ "            end\n"
#~ "        </formula>\n"
#~ "    </discriminator>\n"
#~ "\n"
#~ "    <property name=\"name\" \n"
#~ "        not-null=\"true\"\n"
#~ "        length=\"80\"/>\n"
#~ "        \n"
#~ "    <property name=\"sex\" \n"
#~ "        not-null=\"true\"\n"
#~ "        update=\"false\"/>\n"
#~ "    \n"
#~ "    <component name=\"address\">\n"
#~ "        <property name=\"address\"/>\n"
#~ "        <property name=\"zip\"/>\n"
#~ "        <property name=\"country\"/>\n"
#~ "    </component>\n"
#~ "    \n"
#~ "    <subclass name=\"Employee\" \n"
#~ "        discriminator-value=\"E\">\n"
#~ "            <property name=\"title\"\n"
#~ "                length=\"20\"/>\n"
#~ "            <property name=\"salary\"/>\n"
#~ "            <many-to-one name=\"manager\"/>\n"
#~ "    </subclass>\n"
#~ "    \n"
#~ "    <subclass name=\"Customer\" \n"
#~ "        discriminator-value=\"C\">\n"
#~ "            <property name=\"comments\"/>\n"
#~ "            <many-to-one name=\"salesperson\"/>\n"
#~ "    </subclass>\n"
#~ "    \n"
#~ "</class>"

#, fuzzy
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<class name=\"Person\">\n"
#~ "    \n"
#~ "    <id name=\"id\">\n"
#~ "        <generator class=\"hilo\"/>\n"
#~ "    </id>\n"
#~ "    \n"
#~ "    <property name=\"name\" length=\"100\"/>\n"
#~ "    \n"
#~ "    <one-to-one name=\"address\" \n"
#~ "        property-ref=\"person\"\n"
#~ "        cascade=\"all\"\n"
#~ "        fetch=\"join\"/>\n"
#~ "    \n"
#~ "    <set name=\"accounts\" \n"
#~ "        inverse=\"true\">\n"
#~ "        <key column=\"userId\"\n"
#~ "            property-ref=\"userId\"/>\n"
#~ "        <one-to-many class=\"Account\"/>\n"
#~ "    </set>\n"
#~ "    \n"
#~ "    <property name=\"userId\" length=\"8\"/>\n"
#~ "\n"
#~ "</class>\n"
#~ "\n"
#~ "<class name=\"Address\">\n"
#~ "\n"
#~ "    <id name=\"id\">\n"
#~ "        <generator class=\"hilo\"/>\n"
#~ "    </id>\n"
#~ "\n"
#~ "    <property name=\"address\" length=\"300\"/>\n"
#~ "    <property name=\"zip\" length=\"5\"/>\n"
#~ "    <property name=\"country\" length=\"25\"/>\n"
#~ "    <many-to-one name=\"person\" unique=\"true\" not-null=\"true\"/"
#~ ">\n"
#~ "\n"
#~ "</class>\n"
#~ "\n"
#~ "<class name=\"Account\">\n"
#~ "    <id name=\"accountId\" length=\"32\">\n"
#~ "        <generator class=\"uuid\"/>\n"
#~ "    </id>\n"
#~ "    \n"
#~ "    <many-to-one name=\"user\"\n"
#~ "        column=\"userId\"\n"
#~ "        property-ref=\"userId\"/>\n"
#~ "    \n"
#~ "    <property name=\"type\" not-null=\"true\"/>\n"
#~ "    \n"
#~ "</class>"

Other Hibernate examples (source code examples)

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