⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example_mappings.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 2 页
字号:
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 "Exemplo: Vários Mapeamentos"#. Tag: para#: example_mappings.xml:22#, no-c-formatmsgid "This chapters shows off some more complex association mappings."msgstr "Este capitulo mostra algums mapeamentos de associações mais complexos."#. Tag: title#: example_mappings.xml:27#, no-c-formatmsgid "Employer/Employee"msgstr "Employer/Employee"#. 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 """O modelo de seguinte relacionamento entre <literal>Employer</literal> e ""<literal>Employee</literal> utiliza uma entidade de classe atual ""(<literal>Employment</literal>) para representar a associação. Isto é feito ""porque pode-ser ter mais do que um período de trabalho para as duas partes ""envolvidas. Outros Componentes são usados para modelar valores monetários e ""os nomes do empregado."#. Tag: para#: example_mappings.xml:46#, no-c-formatmsgid "Heres a possible mapping document:"msgstr "Abaixo o código de um possível mapeamento:"#. 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 """E abaixo o esquema da tabela gerado pelo <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 "Author/Work"#. 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 """Considere o seguinte modelo de relacionamento entre <literal>Work</literal>, ""<literal>Author</literal> e <literal>Person</literal>. Nós representamos o ""relacionamento entre <literal>Work</literal> e <literal>Author</literal> ""como uma associação muitos-para-muitos. Nós escolhemos representar o ""relacionamento entre <literal>Author</literal> e <literal>Person</literal> ""como uma associação um-para-um. Outra possibilidade seria ter ""<literal>Author</literal> extendendo <literal>Person</literal>."#. Tag: para#: example_mappings.xml:81#, no-c-formatmsgid """The following mapping document correctly represents these relationships:"msgstr """O mapeamento do código seguinte representa corretamente estes ""relacionamentos:"#. 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 """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>. Existem quatro tabelas neste ""mapeamento. <literal>works</literal>, <literal>authors</literal> e ""<literal>persons</literal> recebem os dados de work, author e person, ""respectivamente. <literal>author_work</literal> é uma tabela de associação ""que liga authors à works. Abaixo o esquema das tabelas, gerados pelo ""<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 "Customer/Order/Product"#. 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 """Agora considere um modelo de relacionamento entre <literal>Customer</""literal>, <literal>Order</literal> e <literal>LineItem</literal> e ""<literal>Product</literal>. Existe uma associação um-para-muitos entre ""<literal>Customer</literal> e <literal>Order</literal>, mas como devemos ""representar <literal>Order</literal> / <literal>LineItem</literal> / ""<literal>Product</literal>? Eu escolhi mapear LineItem como uma classe de ""associação representando a associação muitos-para-muitos entre ""<literal>Order</literal> and <literal>Product</literal>. No Hibernate, isto ""é conhecido como um elemento composto."#. Tag: para#: example_mappings.xml:122#, no-c-formatmsgid "The mapping document:"msgstr "O código do mapeamento:"#. 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> e <literal>products</literal> recebem os dados "

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -