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

📄 collection_mapping.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
📖 第 1 页 / 共 5 页
字号:
"        column=\"column_name\"\n""        formula=\"any SQL expression\"\n""        class=\"ClassName\"\n""        fetch=\"select|join\"\n""        unique=\"true|false\"\n""        not-found=\"ignore|exception\"\n""        entity-name=\"EntityName\"\n""        property-ref=\"propertyNameFromAssociatedClass\"\n""        node=\"element-name\"\n""        embed-xml=\"true|false\"\n""    />]]></programlisting> <calloutlist> <callout arearefs=\"manytomany1\"> ""<para> <literal>column</literal> (optional): The name of the element foreign ""key column. </para> </callout> <callout arearefs=\"manytomany2\"> <para> ""<literal>formula</literal> (optional): An SQL formula used to evaluate the ""element foreign key value. </para> </callout> <callout arearefs=\"manytomany3""\"> <para> <literal>class</literal> (required): The name of the associated ""class. </para> </callout> <callout arearefs=\"manytomany4\"> <para> ""<literal>fetch</literal> (optional - defaults to <literal>join</literal>): ""enables outer-join or sequential select fetching for this association. This ""is a special case; for full eager fetching (in a single <literal>SELECT</""literal>) of an entity and its many-to-many relationships to other entities, ""you would enable <literal>join</literal> fetching not only of the collection ""itself, but also with this attribute on the <literal>&lt;many-to-many&gt;</""literal> nested element. </para> </callout> <callout arearefs=\"manytomany5""\"> <para> <literal>unique</literal> (optional): Enable the DDL generation ""of a unique constraint for the foreign-key column. This makes the ""association multiplicity effectively one to many. </para> </callout> ""<callout arearefs=\"manytomany6\"> <para> <literal>not-found</literal> ""(optional - defaults to <literal>exception</literal>): Specifies how foreign ""keys that reference missing rows will be handled: <literal>ignore</literal> ""will treat a missing row as a null association. </para> </callout> <callout ""arearefs=\"manytomany7\"> <para> <literal>entity-name</literal> (optional): ""The entity name of the associated class, as an alternative to ""<literal>class</literal>. </para> </callout> <callout arearefs=\"manytomany8""\"> <para> <literal>property-ref</literal>: (optional) The name of a ""property of the associated class that is joined to this foreign key. If not ""specified, the primary key of the associated class is used. </para> </""callout> </calloutlist> </programlistingco>"msgstr ""#. Tag: para#: collection_mapping.xml:506#, no-c-formatmsgid "Some examples, first, a set of strings:"msgstr "Quelques exemples, d'abord, un ensemble de chaînes de caractères :"#. Tag: programlisting#: collection_mapping.xml:510#, 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:512#, no-c-formatmsgid """A bag containing integers (with an iteration order determined by the ""<literal>order-by</literal> attribute):"msgstr """Un bag contenant des entiers (avec un ordre d'itération déterminé par ""l'attribut <literal>order-by</literal>) :"#. Tag: programlisting#: collection_mapping.xml:517#, 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:519#, no-c-formatmsgid "An array of entities - in this case, a many to many association:"msgstr """Un tableau d'entités - dans ce cas, une association plusieurs-vers-""plusieurs :"#. Tag: programlisting#: collection_mapping.xml:523#, 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:525#, no-c-formatmsgid "A map from string indices to dates:"msgstr "Une map de chaînes de caractères vers des dates :"#. Tag: programlisting#: collection_mapping.xml:529#, 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:531#, no-c-formatmsgid "A list of components (discussed in the next chapter):"msgstr "Une liste de composants (discute dans le prochain chapitre) :"#. Tag: programlisting#: collection_mapping.xml:535#, 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:540#, no-c-formatmsgid "One-to-many associations"msgstr "Association un-vers-plusieurs"#. Tag: para#: collection_mapping.xml:542#, 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 """Une <emphasis>association un vers plusieurs</emphasis> lie les tables de ""deux classes par une clef étrangère, sans l'intervention d'une table de ""collection. Ce mapping perd certaines sémantiques des collections Java ""normales :"#. Tag: para#: collection_mapping.xml:550#, no-c-formatmsgid """An instance of the contained entity class may not belong to more than one ""instance of the collection"msgstr """Une instance de la classe de l'entité contenue ne peut pas appartenir à plus ""d'une instance de la collection"#. Tag: para#: collection_mapping.xml:556#, no-c-formatmsgid """An instance of the contained entity class may not appear at more than one ""value of the collection index"msgstr """Une instance de la classe de l'entité contenue ne peut pas apparaître plus ""plus d'une valeur d'index de la collection"#. Tag: para#: collection_mapping.xml:563#, 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 """Une association de <literal>Product</literal> vers <literal>Part</literal> ""requiert l'existence d'une clef étrangère et possiblement une colonne ""d'index pour la table <literal>Part</literal>. Une balise <literal>&lt;one-""to-many&gt;</literal> indique que c'est une association un vers plusieurs."#. Tag: programlisting#: collection_mapping.xml:576#, 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:579#, no-c-formatmsgid "<literal>class</literal> (required): The name of the associated class."msgstr "<literal>class</literal> (requis) : le nom de la classe associée"#. Tag: para#: collection_mapping.xml:584#, 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> (optionnel - par défaut <literal>exception</""literal>) : spécifie comment les identifiants cachés qui référencent des ""lignes manquantes seront gérés : <literal>ignore</literal> traitera une ""ligne manquante comme une association nulle"#. Tag: para#: collection_mapping.xml:591#, fuzzy, no-c-formatmsgid """<literal>entity-name</literal> (optional): The entity name of the associated ""class, as an alternative to <literal>class</literal>."msgstr """#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n""<literal>entity-name</literal> (optionnel) : le nom de l'entité de la classe ""associée, comme une alternative à <literal>class</literal>\n""#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n""<literal>entity-name</literal> (optionnel) : le nom de l'entité de la classe ""associée, comme une alternative à <literal>class</literal>."#. Tag: para#: collection_mapping.xml:599#, 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 """Notez que l'élément <literal>&lt;one-to-many&gt;</literal> n'a pas besoin de ""déclarer de colonnes. Il n'est pas non plus nécessaire de spécifier le nom ""de la table nulle part."#. Tag: para#: collection_mapping.xml:605#, 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>Note très importante :</emphasis> si la colonne de la clef d'une ""association <literal>&lt;one-to-many&gt;</literal> est déclarée <literal>NOT ""NULL</literal>, vous devez déclarer le mapping de <literal>&lt;key&gt;</""literal> avec <literal>not-null=\"true\"</literal> ou <emphasis>utiliser une ""association bidirectionnelle</emphasis> avec le mapping de la collection ""marqué <literal>inverse=\"true\"</literal>. Voir la discussion sur les ""associations bidirectionnelles plus tard dans ce chapitre."#. Tag: para#: collection_mapping.xml:614#, 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 """Cet exemple montre une map d'entités <literal>Part</literal> par nom (où ""<literal>partName</literal> est une propriété persistante de <literal>Part</""literal>). Notez l'utilisation d'un index basé sur une formule."#. Tag: programlisting#: collection_mapping.xml:620#, 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:626#, no-c-formatmsgid "Advanced collection mappings"msgstr "Mappings de collection avancés"#. Tag: title#: collection_mapping.xml:629#, no-c-formatmsgid "Sorted collections"msgstr "Collections triées"#. Tag: para#: collection_mapping.xml:631#, 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 supporte des collections implémentant <literal>java.util.""SortedMap</literal> et <literal>java.util.SortedSet</literal>. Vous devez ""spécifier un comparateur dans le fichier de mapping :"#. Tag: programlisting#: collection_mapping.xml:636#, 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:638#, no-c-format

⌨️ 快捷键说明

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