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

📄 inheritance_mapping.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
📖 第 1 页 / 共 2 页
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2008-08-14 15:28+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#: inheritance_mapping.xml:29#, no-c-formatmsgid "Inheritance Mapping"msgstr "Mapping d'héritage de classe"#. Tag: title#: inheritance_mapping.xml:32#, no-c-formatmsgid "The Three Strategies"msgstr "Les trois stratégies"#. Tag: para#: inheritance_mapping.xml:34#, no-c-formatmsgid "Hibernate supports the three basic inheritance mapping strategies:"msgstr "Hibernate supporte les trois stratégies d'héritage de base :"#. Tag: para#: inheritance_mapping.xml:40#, no-c-formatmsgid "table per class hierarchy"msgstr "une table par hiérarchie de classe (table per class hierarchy)"#. Tag: para#: inheritance_mapping.xml:45#, fuzzy, no-c-formatmsgid "<para>table per subclass</para>"msgstr """#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n""une table par classe fille (table per subclass)\n""#-#-#-#-#  - (PACKAGE VERSION)  #-#-#-#-#\n""une table par classe fille"#. Tag: para#: inheritance_mapping.xml:50#, no-c-formatmsgid "table per concrete class"msgstr "une table par classe concrète (table per concrete class)"#. Tag: para#: inheritance_mapping.xml:56#, no-c-formatmsgid """In addition, Hibernate supports a fourth, slightly different kind of ""polymorphism:"msgstr """Hibernate supporte en plus une quatrièmestratégie, légèrement différente, ""qui supporte le polymorphisme :"#. Tag: para#: inheritance_mapping.xml:63#, no-c-formatmsgid "implicit polymorphism"msgstr "le polymorphisme implicite"#. Tag: para#: inheritance_mapping.xml:69#, no-c-formatmsgid """It is possible to use different mapping strategies for different branches of ""the same inheritance hierarchy, and then make use of implicit polymorphism ""to achieve polymorphism across the whole hierarchy. However, Hibernate does ""not support mixing <literal>&lt;subclass&gt;</literal>, and <literal>&lt;""joined-subclass&gt;</literal> and <literal>&lt;union-subclass&gt;</literal> ""mappings under the same root <literal>&lt;class&gt;</literal> element. It is ""possible to mix together the table per hierarchy and table per subclass ""strategies, under the the same <literal>&lt;class&gt;</literal> element, by ""combining the <literal>&lt;subclass&gt;</literal> and <literal>&lt;join&gt;</""literal> elements (see below)."msgstr """Il est possible d'utiliser différentes stratégies de mapping pour ""différentes branches d'une même hiérarchie d'héritage, et alors d'employer ""le polymorphisme implicite pour réaliser le polymorphisme à travers toute la ""hiérarchie. Pourtant, Hibernate ne supporte pas de mélanger des mappings ""<literal>&lt;subclass&gt;</literal> et <literal>&lt;joined-subclass&gt;</""literal> et <literal>&lt;union-subclass&gt;</literal> pour le même élément ""<literal>&lt;class&gt;</literal> racine. Il est possible de mélanger ""ensemble les stratégies d'une table par hiérarchie et d'une table par sous-""classe, pour le même élément <literal>&lt;class&gt;</literal>, en combinant ""les éléments <literal>&lt;subclass&gt;</literal> et <literal>&lt;join&gt;</""literal> (voir dessous)."#. Tag: para#: inheritance_mapping.xml:83#, no-c-formatmsgid """It is possible to define <literal>subclass</literal>, <literal>union-""subclass</literal>, and <literal>joined-subclass</literal> mappings in ""separate mapping documents, directly beneath <literal>hibernate-mapping</""literal>. This allows you to extend a class hierachy just by adding a new ""mapping file. You must specify an <literal>extends</literal> attribute in ""the subclass mapping, naming a previously mapped superclass. Note: ""Previously this feature made the ordering of the mapping documents ""important. Since Hibernate3, the ordering of mapping files does not matter ""when using the extends keyword. The ordering inside a single mapping file ""still needs to be defined as superclasses before subclasses."msgstr """Il est possible de définir des mappings de <literal>subclass</literal>, ""<literal>union-subclass</literal>, et <literal>joined-subclass</literal> ""dans des documents de mapping séparés, directement sous <literal>hibernate-""mapping</literal>. Ceci vous permet d'étendre une hiérarchie de classe juste ""en ajoutant un nouveau fichier de mapping. Vous devez spécifier un attribut ""<literal>extends</literal> dans le mapping de la sous-classe, en nommant une ""super-classe précédemment mappée. Note : précédemment cette foncionnalité ""rendait l'ordre des documents de mapping important. Depuis Hibernate3, ""l'ordre des fichier de mapping n'importe plus lors de l'utilisation du mot-""clef \"extends\". L'ordre à l'intérieur d'un simple fichier de mapping ""impose encore de définir les classes mères avant les classes filles."#. Tag: programlisting#: inheritance_mapping.xml:94#, no-c-formatmsgid """<![CDATA[\n"" <hibernate-mapping>\n""     <subclass name=\"DomesticCat\" extends=\"Cat\" discriminator-value=\"D""\">\n""          <property name=\"name\" type=\"string\"/>\n""     </subclass>\n"" </hibernate-mapping>]]>"msgstr ""#. Tag: title#: inheritance_mapping.xml:98#, no-c-formatmsgid "Table per class hierarchy"msgstr "Une table par hiérarchie de classe"#. Tag: para#: inheritance_mapping.xml:100#, no-c-formatmsgid """Suppose we have an interface <literal>Payment</literal>, with implementors ""<literal>CreditCardPayment</literal>, <literal>CashPayment</literal>, ""<literal>ChequePayment</literal>. The table per hierarchy mapping would look ""like:"msgstr """Supposons que nous ayons une interface <literal>Payment</literal>, ""implémentée par <literal>CreditCardPayment</literal>, <literal>CashPayment</""literal>, <literal>ChequePayment</literal>. La stratégie une table par ""hiérarchie serait :"#. Tag: programlisting#: inheritance_mapping.xml:107#, no-c-formatmsgid """<![CDATA[<class name=\"Payment\" table=\"PAYMENT\">\n""    <id name=\"id\" type=\"long\" column=\"PAYMENT_ID\">\n""        <generator class=\"native\"/>\n""    </id>\n""    <discriminator column=\"PAYMENT_TYPE\" type=\"string\"/>\n""    <property name=\"amount\" column=\"AMOUNT\"/>\n""    ...\n""    <subclass name=\"CreditCardPayment\" discriminator-value=\"CREDIT\">\n""        <property name=\"creditCardType\" column=\"CCTYPE\"/>\n""        ...\n""    </subclass>\n""    <subclass name=\"CashPayment\" discriminator-value=\"CASH\">\n""        ...\n""    </subclass>\n""    <subclass name=\"ChequePayment\" discriminator-value=\"CHEQUE\">\n""        ...\n""    </subclass>\n""</class>]]>"msgstr ""#. Tag: para#: inheritance_mapping.xml:109#, no-c-formatmsgid """Exactly one table is required. There is one big limitation of this mapping ""strategy: columns declared by the subclasses, such as <literal>CCTYPE</""literal>, may not have <literal>NOT NULL</literal> constraints."msgstr """Une seule table est requise. Une grande limitation de cette stratégie est ""que les colonnes déclarées par les classes filles, telles que ""<literal>CCTYPE</literal>, ne peuvent avoir de contrainte <literal>NOT NULL</""literal>."#. Tag: title#: inheritance_mapping.xml:118#, no-c-formatmsgid "Table per subclass"msgstr "Une table par classe fille"#. Tag: para#: inheritance_mapping.xml:120#, no-c-formatmsgid "A table per subclass mapping would look like:"msgstr "La stratégie une table par classe fille serait :"#. Tag: programlisting#: inheritance_mapping.xml:124#, no-c-formatmsgid """<![CDATA[<class name=\"Payment\" table=\"PAYMENT\">\n""    <id name=\"id\" type=\"long\" column=\"PAYMENT_ID\">\n""        <generator class=\"native\"/>\n""    </id>\n""    <property name=\"amount\" column=\"AMOUNT\"/>\n""    ...\n""    <joined-subclass name=\"CreditCardPayment\" table=\"CREDIT_PAYMENT\">\n""        <key column=\"PAYMENT_ID\"/>\n""        <property name=\"creditCardType\" column=\"CCTYPE\"/>\n""        ...\n""    </joined-subclass>\n""    <joined-subclass name=\"CashPayment\" table=\"CASH_PAYMENT\">\n""        <key column=\"PAYMENT_ID\"/>\n""        ...\n""    </joined-subclass>\n""    <joined-subclass name=\"ChequePayment\" table=\"CHEQUE_PAYMENT\">\n""        <key column=\"PAYMENT_ID\"/>\n""        ...\n""    </joined-subclass>\n""</class>]]>"msgstr ""#. Tag: para#: inheritance_mapping.xml:126#, no-c-formatmsgid """Four tables are required. The three subclass tables have primary key ""associations to the superclass table (so the relational model is actually a ""one-to-one association)."msgstr """Quatre tables sont requises. Les trois tables des classes filles ont une clé ""primaire associée à la table classe mère (le modèle relationnel est une ""association un-vers-un)."#. Tag: title#: inheritance_mapping.xml:135#, no-c-formatmsgid "Table per subclass, using a discriminator"msgstr "Une table par classe fille, en utilisant un discriminant"#. Tag: para#: inheritance_mapping.xml:137#, no-c-formatmsgid """Note that Hibernate's implementation of table per subclass requires no ""discriminator column. Other object/relational mappers use a different ""implementation of table per subclass which requires a type discriminator ""column in the superclass table. The approach taken by Hibernate is much more ""difficult to implement but arguably more correct from a relational point of ""view. If you would like to use a discriminator column with the table per ""subclass strategy, you may combine the use of <literal>&lt;subclass&gt;</""literal> and <literal>&lt;join&gt;</literal>, as follow:"msgstr """Notez que l'implémentation Hibernate de la stratégie un table par classe ""fille ne nécessite pas de colonne discriminante dans la table classe mère. ""D'autres implémentations de mappers Objet/Relationnel utilisent une autre ""implémentation de la stratégie une table par classe fille qui nécessite une ""colonne de type discriminant dans la table de la classe mère. L'approche ""prise par Hibernate est plus difficile à implémenter mais plus correcte ""d'une point de vue relationnel. Si vous aimeriez utiliser une colonne ""discriminante avec la stratégie d'une table par classe fille, vous pourriez ""combiner l'utilisation de <literal>&lt;subclass&gt;</literal> et ""<literal>&lt;join&gt;</literal>, comme suit :"#. Tag: programlisting#: inheritance_mapping.xml:149#, no-c-formatmsgid """<![CDATA[<class name=\"Payment\" table=\"PAYMENT\">\n""    <id name=\"id\" type=\"long\" column=\"PAYMENT_ID\">\n""        <generator class=\"native\"/>\n""    </id>\n""    <discriminator column=\"PAYMENT_TYPE\" type=\"string\"/>\n""    <property name=\"amount\" column=\"AMOUNT\"/>\n""    ...\n""    <subclass name=\"CreditCardPayment\" discriminator-value=\"CREDIT\">\n""        <join table=\"CREDIT_PAYMENT\">\n""            <key column=\"PAYMENT_ID\"/>\n""            <property name=\"creditCardType\" column=\"CCTYPE\"/>\n""            ...\n""        </join>\n""    </subclass>\n""    <subclass name=\"CashPayment\" discriminator-value=\"CASH\">\n""        <join table=\"CASH_PAYMENT\">\n""            <key column=\"PAYMENT_ID\"/>\n""            ...\n""        </join>\n""    </subclass>\n""    <subclass name=\"ChequePayment\" discriminator-value=\"CHEQUE\">\n""        <join table=\"CHEQUE_PAYMENT\" fetch=\"select\">\n""            <key column=\"PAYMENT_ID\"/>\n""            ...\n""        </join>\n""    </subclass>\n""</class>]]>"msgstr ""#. Tag: para#: inheritance_mapping.xml:151#, no-c-formatmsgid """The optional <literal>fetch=\"select\"</literal> declaration tells Hibernate ""not to fetch the <literal>ChequePayment</literal> subclass data using an ""outer join when querying the superclass."msgstr """La déclaration optionnelle <literal>fetch=\"select\"</literal> indique à ""Hibernate de ne pas récupérer les données de la classe fille ""<literal>ChequePayment</literal> par une jointure externe lors des requêtes ""sur la classe mère."#. Tag: title#: inheritance_mapping.xml:160#, no-c-formatmsgid "Mixing table per class hierarchy with table per subclass"msgstr """Mélange d'une table par hiérarchie de classe avec une table par classe fille"#. Tag: para#: inheritance_mapping.xml:162#, no-c-formatmsgid """You may even mix the table per hierarchy and table per subclass strategies ""using this approach:"msgstr """Vous pouvez même mélanger les stratégies d'une table par hiérarchie de ""classe et d'une table par classe fille en utilisant cette approche :"#. Tag: programlisting#: inheritance_mapping.xml:167#, no-c-formatmsgid """<![CDATA[<class name=\"Payment\" table=\"PAYMENT\">\n""    <id name=\"id\" type=\"long\" column=\"PAYMENT_ID\">\n""        <generator class=\"native\"/>\n""    </id>\n""    <discriminator column=\"PAYMENT_TYPE\" type=\"string\"/>\n""    <property name=\"amount\" column=\"AMOUNT\"/>\n""    ...\n""    <subclass name=\"CreditCardPayment\" discriminator-value=\"CREDIT\">\n""        <join table=\"CREDIT_PAYMENT\">\n""            <property name=\"creditCardType\" column=\"CCTYPE\"/>\n""            ...\n""        </join>\n""    </subclass>\n""    <subclass name=\"CashPayment\" discriminator-value=\"CASH\">\n""        ...\n""    </subclass>\n""    <subclass name=\"ChequePayment\" discriminator-value=\"CHEQUE\">\n""        ...\n""    </subclass>\n""</class>]]>"msgstr ""#. Tag: para#: inheritance_mapping.xml:169#, no-c-formatmsgid """For any of these mapping strategies, a polymorphic association to the root ""<literal>Payment</literal> class is mapped using <literal>&lt;many-to-one&gt;""</literal>."msgstr """Pour importe laquelle de ces stratégies, une association polymorphique vers ""la classe racine <literal>Payment</literal> est mappée en utilisant ""<literal>&lt;many-to-one&gt;</literal>."#. Tag: programlisting#: inheritance_mapping.xml:175#, no-c-formatmsgid """<![CDATA[<many-to-one name=\"payment\" column=\"PAYMENT_ID\" class=\"Payment""\"/>]]>"msgstr ""#. Tag: title#: inheritance_mapping.xml:180#, no-c-formatmsgid "Table per concrete class"msgstr "Une table par classe concrète"#. Tag: para#: inheritance_mapping.xml:182#, no-c-formatmsgid """There are two ways we could go about mapping the table per concrete class ""strategy. The first is to use <literal>&lt;union-subclass&gt;</literal>."msgstr """Il y a deux manières d'utiliser la stratégie d'une table par classe ""concrète. La première est d'employer <literal>&lt;union-subclass&gt;</""literal>."#. Tag: programlisting#: inheritance_mapping.xml:187#, no-c-formatmsgid """<![CDATA[<class name=\"Payment\">\n""    <id name=\"id\" type=\"long\" column=\"PAYMENT_ID\">\n""        <generator class=\"sequence\"/>\n""    </id>\n""    <property name=\"amount\" column=\"AMOUNT\"/>\n""    ...\n""    <union-subclass name=\"CreditCardPayment\" table=\"CREDIT_PAYMENT\">\n""        <property name=\"creditCardType\" column=\"CCTYPE\"/>\n""        ...\n""    </union-subclass>\n""    <union-subclass name=\"CashPayment\" table=\"CASH_PAYMENT\">\n""        ...\n""    </union-subclass>\n""    <union-subclass name=\"ChequePayment\" table=\"CHEQUE_PAYMENT\">\n""        ...\n""    </union-subclass>\n""</class>]]>"msgstr ""#. Tag: para#: inheritance_mapping.xml:189#, no-c-formatmsgid """Three tables are involved for the subclasses. Each table defines columns for ""all properties of the class, including inherited properties."msgstr """Trois tables sont nécessaires pour les classes filles. Chaque table définit ""des colonnes pour toutes les propriétés de la classe, incluant les ""propriétés héritéés."#. Tag: para

⌨️ 快捷键说明

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