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

📄 collection_mapping.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
msgid "Some examples, first, a set of strings:"msgstr "Some examples, first, a set of strings:"#. Tag: programlisting#: collection_mapping.xml:484#, no-c-formatmsgid """<![CDATA[<set name=\"names\" table=\"person_names\">\n""    <key column=\"person_id\"/>\n""    <element column=\"person_name\" type=\"string\"/>\n""</set>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:486#, no-c-formatmsgid """A bag containing integers (with an iteration order determined by the ""<literal>order-by</literal> attribute):"msgstr """A bag containing integers (with an iteration order determined by the ""<literal>order-by</literal> attribute):"#. Tag: programlisting#: collection_mapping.xml:491#, no-c-formatmsgid """<![CDATA[<bag name=\"sizes\" \n""        table=\"item_sizes\" \n""        order-by=\"size asc\">\n""    <key column=\"item_id\"/>\n""    <element column=\"size\" type=\"integer\"/>\n""</bag>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:493#, no-c-formatmsgid "An array of entities - in this case, a many to many association:"msgstr "An array of entities - in this case, a many to many association:"#. Tag: programlisting#: collection_mapping.xml:497#, no-c-formatmsgid """<![CDATA[<array name=\"addresses\" \n""        table=\"PersonAddress\" \n""        cascade=\"persist\">\n""    <key column=\"personId\"/>\n""    <list-index column=\"sortOrder\"/>\n""    <many-to-many column=\"addressId\" class=\"Address\"/>\n""</array>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:499#, no-c-formatmsgid "A map from string indices to dates:"msgstr "A map from string indices to dates:"#. Tag: programlisting#: collection_mapping.xml:503#, no-c-formatmsgid """<![CDATA[<map name=\"holidays\" \n""        table=\"holidays\" \n""        schema=\"dbo\" \n""        order-by=\"hol_name asc\">\n""    <key column=\"id\"/>\n""    <map-key column=\"hol_name\" type=\"string\"/>\n""    <element column=\"hol_date\" type=\"date\"/>\n""</map>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:505#, no-c-formatmsgid "A list of components (discussed in the next chapter):"msgstr "A list of components (discussed in the next chapter):"#. Tag: programlisting#: collection_mapping.xml:509#, no-c-formatmsgid """<![CDATA[<list name=\"carComponents\" \n""        table=\"CarComponents\">\n""    <key column=\"carId\"/>\n""    <list-index column=\"sortOrder\"/>\n""    <composite-element class=\"CarComponent\">\n""        <property name=\"price\"/>\n""        <property name=\"type\"/>\n""        <property name=\"serialNumber\" column=\"serialNum\"/>\n""    </composite-element>\n""</list>]]>"msgstr ""#. Tag: title#: collection_mapping.xml:514#, no-c-formatmsgid "One-to-many associations"msgstr "One-to-many associations"#. Tag: para#: collection_mapping.xml:516#, no-c-formatmsgid """A <emphasis>one to many association</emphasis> links the tables of two ""classes via a foreign key, with no intervening collection table. This ""mapping loses certain semantics of normal Java collections:"msgstr """A <emphasis>one to many association</emphasis> links the tables of two ""classes via a foreign key, with no intervening collection table. This ""mapping loses certain semantics of normal Java collections:"#. Tag: para#: collection_mapping.xml:524#, no-c-formatmsgid """An instance of the contained entity class may not belong to more than one ""instance of the collection"msgstr """An instance of the contained entity class may not belong to more than one ""instance of the collection"#. Tag: para#: collection_mapping.xml:530#, no-c-formatmsgid """An instance of the contained entity class may not appear at more than one ""value of the collection index"msgstr """An instance of the contained entity class may not appear at more than one ""value of the collection index"#. Tag: para#: collection_mapping.xml:537#, no-c-formatmsgid """An association from <literal>Product</literal> to <literal>Part</literal> ""requires existence of a foreign key column and possibly an index column to ""the <literal>Part</literal> table. A <literal>&lt;one-to-many&gt;</literal> ""tag indicates that this is a one to many association."msgstr """An association from <literal>Product</literal> to <literal>Part</literal> ""requires existence of a foreign key column and possibly an index column to ""the <literal>Part</literal> table. A <literal>&lt;one-to-many&gt;</literal> ""tag indicates that this is a one to many association."#. Tag: programlisting#: collection_mapping.xml:550#, no-c-formatmsgid """<![CDATA[<one-to-many \n""        class=\"ClassName\"\n""        not-found=\"ignore|exception\"\n""        entity-name=\"EntityName\"\n""        node=\"element-name\"\n""        embed-xml=\"true|false\"\n""    />]]>"msgstr ""#. Tag: para#: collection_mapping.xml:553#, no-c-formatmsgid "<literal>class</literal> (required): The name of the associated class."msgstr "<literal>class</literal> (required): The name of the associated class."#. Tag: para#: collection_mapping.xml:558#, no-c-formatmsgid """<literal>not-found</literal> (optional - defaults to <literal>exception</""literal>): Specifies how cached identifiers that reference missing rows will ""be handled: <literal>ignore</literal> will treat a missing row as a null ""association."msgstr """<literal>not-found</literal> (optional - defaults to <literal>exception</""literal>): Specifies how cached identifiers that reference missing rows will ""be handled: <literal>ignore</literal> will treat a missing row as a null ""association."#. Tag: para#: collection_mapping.xml:565#, no-c-formatmsgid """<literal>entity-name</literal> (optional): The entity name of the associated ""class, as an alternative to <literal>class</literal>."msgstr """<literal>entity-name</literal> (optional): The entity name of the associated ""class, as an alternative to <literal>class</literal>."#. Tag: para#: collection_mapping.xml:573#, no-c-formatmsgid """Notice that the <literal>&lt;one-to-many&gt;</literal> element does not need ""to declare any columns. Nor is it necessary to specify the <literal>table</""literal> name anywhere."msgstr """Notice that the <literal>&lt;one-to-many&gt;</literal> element does not need ""to declare any columns. Nor is it necessary to specify the <literal>table</""literal> name anywhere."#. Tag: para#: collection_mapping.xml:579#, no-c-formatmsgid """<emphasis>Very important note:</emphasis> If the foreign key column of a ""<literal>&lt;one-to-many&gt;</literal> association is declared <literal>NOT ""NULL</literal>, you must declare the <literal>&lt;key&gt;</literal> mapping ""<literal>not-null=\"true\"</literal> or <emphasis>use a bidirectional ""association</emphasis> with the collection mapping marked <literal>inverse=""\"true\"</literal>. See the discussion of bidirectional associations later ""in this chapter."msgstr """<emphasis>Very important note:</emphasis> If the foreign key column of a ""<literal>&lt;one-to-many&gt;</literal> association is declared <literal>NOT ""NULL</literal>, you must declare the <literal>&lt;key&gt;</literal> mapping ""<literal>not-null=\"true\"</literal> or <emphasis>use a bidirectional ""association</emphasis> with the collection mapping marked <literal>inverse=""\"true\"</literal>. See the discussion of bidirectional associations later ""in this chapter."#. Tag: para#: collection_mapping.xml:588#, no-c-formatmsgid """This example shows a map of <literal>Part</literal> entities by name (where ""<literal>partName</literal> is a persistent property of <literal>Part</""literal>). Notice the use of a formula-based index."msgstr """This example shows a map of <literal>Part</literal> entities by name (where ""<literal>partName</literal> is a persistent property of <literal>Part</""literal>). Notice the use of a formula-based index."#. Tag: programlisting#: collection_mapping.xml:594#, no-c-formatmsgid """<![CDATA[<map name=\"parts\"\n""        cascade=\"all\">\n""    <key column=\"productId\" not-null=\"true\"/>\n""    <map-key formula=\"partName\"/>\n""    <one-to-many class=\"Part\"/>\n""</map>]]>"msgstr ""#. Tag: title#: collection_mapping.xml:600#, no-c-formatmsgid "Advanced collection mappings"msgstr "Advanced collection mappings"#. Tag: title#: collection_mapping.xml:603#, no-c-formatmsgid "Sorted collections"msgstr "Sorted collections"#. Tag: para#: collection_mapping.xml:605#, no-c-formatmsgid """Hibernate supports collections implementing <literal>java.util.SortedMap</""literal> and <literal>java.util.SortedSet</literal>. You must specify a ""comparator in the mapping file:"msgstr """Hibernate supports collections implementing <literal>java.util.SortedMap</""literal> and <literal>java.util.SortedSet</literal>. You must specify a ""comparator in the mapping file:"#. Tag: programlisting#: collection_mapping.xml:610#, no-c-formatmsgid """<![CDATA[<set name=\"aliases\" \n""            table=\"person_aliases\" \n""            sort=\"natural\">\n""    <key column=\"person\"/>\n""    <element column=\"name\" type=\"string\"/>\n""</set>\n""\n""<map name=\"holidays\" sort=\"my.custom.HolidayComparator\">\n""    <key column=\"year_id\"/>\n""    <map-key column=\"hol_name\" type=\"string\"/>\n""    <element column=\"hol_date\" type=\"date\"/>\n""</map>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:612#, no-c-formatmsgid """Allowed values of the <literal>sort</literal> attribute are ""<literal>unsorted</literal>, <literal>natural</literal> and the name of a ""class implementing <literal>java.util.Comparator</literal>."msgstr """Allowed values of the <literal>sort</literal> attribute are ""<literal>unsorted</literal>, <literal>natural</literal> and the name of a ""class implementing <literal>java.util.Comparator</literal>."#. Tag: para#: collection_mapping.xml:618#, no-c-formatmsgid """Sorted collections actually behave like <literal>java.util.TreeSet</literal> ""or <literal>java.util.TreeMap</literal>."msgstr """Sorted collections actually behave like <literal>java.util.TreeSet</literal> ""or <literal>java.util.TreeMap</literal>."#. Tag: para#: collection_mapping.xml:623#, no-c-formatmsgid """If you want the database itself to order the collection elements use the ""<literal>order-by</literal> attribute of <literal>set</literal>, ""<literal>bag</literal> or <literal>map</literal> mappings. This solution is ""only available under JDK 1.4 or higher (it is implemented using ""<literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>). This ""performs the ordering in the SQL query, not in memory."msgstr """If you want the database itself to order the collection elements use the ""<literal>order-by</literal> attribute of <literal>set</literal>, ""<literal>bag</literal> or <literal>map</literal> mappings. This solution is ""only available under JDK 1.4 or higher (it is implemented using ""<literal>LinkedHashSet</literal> or <literal>LinkedHashMap</literal>). This ""performs the ordering in the SQL query, not in memory."#. Tag: programlisting#: collection_mapping.xml:632#, no-c-formatmsgid """<![CDATA[<set name=\"aliases\" table=\"person_aliases\" order-by=\"lower""(name) asc\">\n""    <key column=\"person\"/>\n""    <element column=\"name\" type=\"string\"/>\n""</set>\n""\n""<map name=\"holidays\" order-by=\"hol_date, hol_name\">\n""    <key column=\"year_id\"/>\n""    <map-key column=\"hol_name\" type=\"string\"/>\n""    <element column=\"hol_date type=\"date\"/>\n""</map>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:634#, no-c-formatmsgid """Note that the value of the <literal>order-by</literal> attribute is an SQL ""ordering, not a HQL ordering!"msgstr ""

⌨️ 快捷键说明

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