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

📄 collection_mapping.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
📖 第 1 页 / 共 5 页
字号:
"    ...\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 """<![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>]]>"#: index.docbook:691msgid """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 """Los cambios hechos s&#x00f3;lo al extremo inverso de la asociaci&#x00f3;n ""<emphasis>no</emphasis> son persistidos. Esto significa que Hibernate tiene ""dos representaciones en memoria para cada asociaci&#x00f3;n bidireccional, ""una enlaza de A a B y otra enlaza de B a A. Esto es m&#x00e1;s f&#x00e1;cil ""de entender si piensas en el modelo de objetos de Java y c&#x00f3;mo creamos ""una relaci&#x00f3;n muchos-a-muchos en Java:"#: index.docbook:699msgid """<![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 """<![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]]>"#: index.docbook:701msgid """The non-inverse side is used to save the in-memory representation to the ""database."msgstr """El lado no-inverso se usa para salvar la representaci&#x00f3;n en memoria a ""la base de datos."#: index.docbook:705msgid """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 """Puedes definir una asociaci&#x00f3;n bidireccional uno-a-muchos mapeando una ""asociaci&#x00f3;n uno-a-muchos a la misma columna (o columnas) de tabla como ""una asociaci&#x00f3;n muchos-a-uno y declarando el extremo multivaluado ""<literal>inverse=\"true\"</literal>."#: index.docbook:711msgid """<![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 """<![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=\"eg.Child\">\n""    <id name=\"id\" column=\"id\"/>\n""    ....\n""    <many-to-one name=\"parent\" \n""        class=\"Parent\" \n""        column=\"parent_id\"\n""        not-null=\"true\"/>\n""</class>]]>"#: index.docbook:713msgid """Mapping one end of an association with <literal>inverse=\"true\"</literal> ""doesn't affect the operation of cascades, these are orthogonal concepts!"msgstr """Mapear un extremo de una asociaci&#x00f3;n con <literal>inverse=\"true\"</""literal> no afecta la operaci&#x00f3;n de cascadas; &#x00e9;stos son ""conceptos ortogonales!"#: index.docbook:721msgid "Bidirectional associations with indexed collections"msgstr "Asociaciones bidireccionales con colecciones indexadas"#: index.docbook:722msgid """A bidirectional association where one end is represented as a <literal>&lt;""list&gt;</literal> or <literal>&lt;map&gt;</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 """Requiere especial consideraci&#x00f3;n una asociaci&#x00f3;n bidireccional ""donde un extremo est&#x00e9; representado como una <literal>&lt;list&gt;</""literal> o <literal>&lt;map&gt;</literal>. Si hay una propiedad de la clase ""hija que mapee a la columna &#x00ed;ndice, no hay problema, podemos seguir ""usando <literal>inverse=\"true\"</literal> en el mapeo de la colecci&#x00f3;""n:"#: index.docbook:729msgid """<![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 """<![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>]]>"#: index.docbook:731msgid """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 """Pero, si no existe tal proiedad en la clase hija, no podemos pensar en la ""asociaci&#x00f3;n como verdaderamente bidireccional (hay informaci&#x00f3;n ""en un extremo de la asociaci&#x00f3;n que no est&#x00e1; disponible en el ""otro extremo). En este caso, no podemos mapear la colecci&#x00f3;n con ""<literal>inverse=\"true\"</literal>. En cambio, podr&#x00ed;amos usar el ""siguiente mapeo:"#: index.docbook:738msgid """<![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""        <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""    <many-to-one name=\"parent\" \n""        class=\"Parent\" \n""        column=\"parent_id\"\n""        insert=\"false\"\n""        update=\"false\"\n""        not-null=\"true\"/>\n""</class>]]>"msgstr """<![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""        <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""    <many-to-one name=\"parent\" \n""        class=\"Parent\" \n""        column=\"parent_id\"\n""        insert=\"false\"\n""        update=\"false\"\n""        not-null=\"true\"/>\n""</class>]]>"#: index.docbook:740msgid """Note that in this mapping, the collection-valued end of the association is ""responsible for updates to the foreign key. TODO: Does this really result in ""some unnecessary update statements?"msgstr """Nota que, en este mapeo, el extremo de la asociaci&#x00f3;n valuado en ""colecci&#x00f3;n es responsable de las actualizaciones a la clave for&#x00e1;""nea."#: index.docbook:748msgid "Ternary associations"msgstr "Asociaciones ternarias"#: index.docbook:750msgid """There are three possible approaches to mapping a ternary association. One is ""to use a <literal>Map</literal> with an association as its index:"msgstr """Hay tres enfoques posibles para mapear una asociaci&#x00f3;n ternaria. Una ""es usar un <literal>Map</literal> con una asociaci&#x00f3;n como su &#x00ed;""ndice:"#: index.docbook:755msgid """<![CDATA[<map name=\"contracts\">\n""    <key column=\"employer_id\" not-null=\"true\"/>\n""    <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n""    <one-to-many class=\"Contract\"/>\n""</map>]]>"msgstr """<![CDATA[<map name=\"contracts\">\n""    <key column=\"employer_id\" not-null=\"true\"/>\n""    <map-key-many-to-many column=\"employee_id\" class=\"Employee\"/>\n""    <one-to-many class=

⌨️ 快捷键说明

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