📄 collection_mapping.po
字号:
msgid """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 """Les valeurs permises pour l'attribut <literal>sort</literal> sont ""<literal>unsorted</literal>, <literal>natural</literal> et le nom d'une ""classe implémentant <literal>java.util.Comparator</literal>."#. Tag: para#: collection_mapping.xml:644#, no-c-formatmsgid """Sorted collections actually behave like <literal>java.util.TreeSet</literal> ""or <literal>java.util.TreeMap</literal>."msgstr """Les collections triées se comportent réellement comme <literal>java.util.""TreeSet</literal> ou <literal>java.util.TreeMap</literal>."#. Tag: para#: collection_mapping.xml:649#, 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 """Si vous voulez que la base de données elle-même ordonne les éléments de la ""collection, utilisez l'attribut <literal>order-by</literal> des mappings ""<literal>set</literal>, <literal>bag</literal> ou <literal>map</literal>. ""Cette solution est seulement disponible à partir du JDK 1.4 (c'est ""implémenté en utilisant <literal>LinkedHashSet</literal> ou ""<literal>LinkedHashMap</literal>). Ceci exécute le tri dans la requête SQL, ""pas en mémoire."#. Tag: programlisting#: collection_mapping.xml:658#, 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:660#, no-c-formatmsgid """Note that the value of the <literal>order-by</literal> attribute is an SQL ""ordering, not a HQL ordering!"msgstr """Notez que la valeur de l'attribut <literal>order-by</literal> est un ordre ""SQL, pas un ordre HQL !"#. Tag: para#: collection_mapping.xml:665#, no-c-formatmsgid """Associations may even be sorted by some arbitrary criteria at runtime using ""a collection <literal>filter()</literal>."msgstr """Les associations peuvent même être triées sur des critères arbitraires à ""l'exécution en utilisant un <literal>filter()</literal> de collection."#. Tag: programlisting#: collection_mapping.xml:670#, no-c-formatmsgid """<![CDATA[sortedUsers = s.createFilter( group.getUsers(), \"order by this.name""\" ).list();]]>"msgstr ""#. Tag: title#: collection_mapping.xml:675#, no-c-formatmsgid "Bidirectional associations"msgstr "Associations bidirectionnelles"#. Tag: para#: collection_mapping.xml:677#, fuzzy, no-c-formatmsgid """A <emphasis>bidirectional association</emphasis> allows navigation from both ""\"ends\" of the association. Two kinds of bidirectional association are ""supported:"msgstr """Une <emphasis>association bidirectionnelle</emphasis> permet une navigation ""à partir de la \"fin\" de l'association. Deux sortes d'associations ""bidirectionnelles sont supportées : <placeholder-1/>"#. Tag: term#: collection_mapping.xml:684#, no-c-formatmsgid "one-to-many"msgstr "un-vers-plusieurs (NdT : one-to-many)"#. Tag: para#: collection_mapping.xml:686#, no-c-formatmsgid "set or bag valued at one end, single-valued at the other"msgstr "ensemble ou sac à une extrémité, une seule valeur à l'autre"#. Tag: term#: collection_mapping.xml:692#, no-c-formatmsgid "many-to-many"msgstr "plusieurs-vers-plusieurs (NdT : many-to-many)"#. Tag: para#: collection_mapping.xml:694#, no-c-formatmsgid "set or bag valued at both ends"msgstr "ensemble ou sac aux deux extrémités"#. Tag: para#: collection_mapping.xml:703#, no-c-formatmsgid """You may specify a bidirectional many-to-many association simply by mapping ""two many-to-many associations to the same database table and declaring one ""end as <emphasis>inverse</emphasis> (which one is your choice, but it can ""not be an indexed collection)."msgstr """Vous pouvez spécifier une association plusieurs-vers-plusieurs ""bidirectionnelle simplement en mappant deux associations plusieurs-vers-""plusieurs vers la même table de base de données et en déclarant une ""extrémité comme <emphasis>inverse</emphasis> (celle de votre choix, mais ça ""ne peut pas être une collection indexée)."#. Tag: para#: collection_mapping.xml:710#, no-c-formatmsgid """Here's an example of a bidirectional many-to-many association; each category ""can have many items and each item can be in many categories:"msgstr """Voici un exemple d'association bidirectionnelle plusieurs-vers-plusieurs ; ""chaque catégorie peut avoir plusieurs objets et chaque objet peut être dans ""plusieurs catégories :"#. Tag: programlisting#: collection_mapping.xml:715#, no-c-formatmsgid """<![CDATA[<class name=\"Category\">\n"" <id name=\"id\" column=\"CATEGORY_ID\"/>\n"" ...\n"" <bag name=\"items\" table=\"CATEGORY_ITEM\">\n"" <key column=\"CATEGORY_ID\"/>\n"" <many-to-many class=\"Item\" column=\"ITEM_ID\"/>\n"" </bag>\n""</class>\n""\n""<class name=\"Item\">\n"" <id name=\"id\" column=\"ITEM_ID\"/>\n"" ...\n""\n"" <!-- inverse end -->\n"" <bag name=\"categories\" table=\"CATEGORY_ITEM\" inverse=\"true\">\n"" <key column=\"ITEM_ID\"/>\n"" <many-to-many class=\"Category\" column=\"CATEGORY_ID\"/>\n"" </bag>\n""</class>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:717#, no-c-formatmsgid """Changes made only to the inverse end of the association are <emphasis>not</""emphasis> persisted. This means that Hibernate has two representations in ""memory for every bidirectional association, one link from A to B and another ""link from B to A. This is easier to understand if you think about the Java ""object model and how we create a many-to-many relationship in Java:"msgstr """Les changements faits uniquement sur l'extréminté inverse de l'association ""<emphasis>ne sont pas</emphasis> persistés. Ceci signifie qu'Hibernate a ""deux représentations en mémoire pour chaque association bidirectionnelles, ""un lien de A vers B et un autre de B vers A. C'est plus facile à comprendre ""si vous pensez au modèle objet de Java et comment nous créons une relation ""plusieurs-vers-plusieurs en Java :"#. Tag: programlisting#: collection_mapping.xml:725#, no-c-formatmsgid """<![CDATA[\n""category.getItems().add(item); // The category now \"knows\" about ""the relationship\n""item.getCategories().add(category); // The item now \"knows\" about the ""relationship\n""\n""session.persist(item); // The relationship won't be ""saved!\n""session.persist(category); // The relationship will be saved]]>"msgstr ""#. Tag: para#: collection_mapping.xml:727#, no-c-formatmsgid """The non-inverse side is used to save the in-memory representation to the ""database."msgstr """La partie non-inverse est utilisée pour sauvegarder la représentation en ""mémoire dans la base de données."#. Tag: para#: collection_mapping.xml:731#, no-c-formatmsgid """You may define a bidirectional one-to-many association by mapping a one-to-""many association to the same table column(s) as a many-to-one association ""and declaring the many-valued end <literal>inverse=\"true\"</literal>."msgstr """Vous pouvez définir une association un-vers-plusieurs bidirectionnelle en ""mappant une association un-vers-plusieurs vers la(es) même(s) colonne(s) de ""table qu'une association plusieurs-vers-un et en déclarant l'extrémité pluri-""valuée <literal>inverse=\"true\"</literal>."#. Tag: programlisting#: collection_mapping.xml:737#, no-c-formatmsgid """<![CDATA[<class name=\"Parent\">\n"" <id name=\"id\" column=\"parent_id\"/>\n"" ....\n"" <set name=\"children\" inverse=\"true\">\n"" <key column=\"parent_id\"/>\n"" <one-to-many class=\"Child\"/>\n"" </set>\n""</class>\n""\n""<class name=\"Child\">\n"" <id name=\"id\" column=\"child_id\"/>\n"" ....\n"" <many-to-one name=\"parent\" \n"" class=\"Parent\" \n"" column=\"parent_id\"\n"" not-null=\"true\"/>\n""</class>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:739#, no-c-formatmsgid """Mapping one end of an association with <literal>inverse=\"true\"</literal> ""doesn't affect the operation of cascades, these are orthogonal concepts!"msgstr """Mapper une extrémité d'une association avec <literal>inverse=\"true\"</""literal> n'affecte pas l'opération de cascades, ce sont des concepts ""orthogonaux !"#. Tag: title#: collection_mapping.xml:747#, no-c-formatmsgid "Bidirectional associations with indexed collections"msgstr "Associations bidirectionnelles avec des collections indexées"#. Tag: para#: collection_mapping.xml:748#, no-c-formatmsgid """A bidirectional association where one end is represented as a <literal><""list></literal> or <literal><map></literal> requires special ""consideration. If there is a property of the child class which maps to the ""index column, no problem, we can continue using <literal>inverse=\"true\"</""literal> on the collection mapping:"msgstr """Une association bidirectionnelle où une extrémité est représentée comme une ""<literal><list></literal> ou une <literal><map></literal> ""requiert une considération spéciale. Si il y a une propriété de la classe ""enfant qui mappe la colonne de l'index, pas de problème, nous pouvons ""continuer à utiliser <literal>inverse=\"true\"</literal> sur le mapping de ""la collection :"#. Tag: programlisting#: collection_mapping.xml:755#, no-c-formatmsgid """<![CDATA[<class name=\"Parent\">\n"" <id name=\"id\" column=\"parent_id\"/>\n"" ....\n"" <map name=\"children\" inverse=\"true\">\n"" <key column=\"parent_id\"/>\n"" <map-key column=\"name\" \n"" type=\"string\"/>\n"" <one-to-many class=\"Child\"/>\n"" </map>\n""</class>\n""\n""<class name=\"Child\">\n"" <id name=\"id\" column=\"child_id\"/>\n"" ....\n"" <property name=\"name\" \n"" not-null=\"true\"/>\n"" <many-to-one name=\"parent\" \n"" class=\"Parent\" \n"" column=\"parent_id\"\n"" not-null=\"true\"/>\n""</class>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:757#, no-c-formatmsgid """But, if there is no such property on the child class, we can't think of the ""association as truly bidirectional (there is information available at one ""end of the association that is not available at the other end). In this ""case, we can't map the collection <literal>inverse=\"true\"</literal>. ""Instead, we could use the following mapping:"msgstr """Mais, si il n'y a pas de telle prorpriété sur la classe enfant, nous ne ""pouvons pas penser à l'association comme vraiment bidirectionnelle (il y a ""des informations disponibles à une extrémité de l'association qui ne sont ""pas disponibles à l'autre extrémité). Dans ce cas, nous ne pouvons pas ""mapper la collection <literal>inverse=\"true\"</literal>. À la place, nous ""pourrions utiliser le mapping suivant :"#. Tag: programlisting#: collection_mapping.xml:764#, no-c-formatmsgid """<![CDATA[<class name=\"Parent\">\n"" <id name=\"id\" column=\"parent_id\"/>\n"" ....\n"" <map name=\"children\">\n"" <key column=\"parent_id\"\n"" not-null=\"true\"/>\n"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -