📄 collection_mapping.po
字号:
"literal>): The strategy Hibernate should use for accessing the collection ""property value."#. Tag: para#: collection_mapping.xml:180#, no-c-formatmsgid """<literal>optimistic-lock</literal> (optional - defaults to <literal>true</""literal>): Species that changes to the state of the collection results in ""increment of the owning entity's version. (For one to many associations, it ""is often reasonable to disable this setting.)"msgstr """<literal>optimistic-lock</literal> (optional - defaults to <literal>true</""literal>): Species that changes to the state of the collection results in ""increment of the owning entity's version. (For one to many associations, it ""is often reasonable to disable this setting.)"#. Tag: para#: collection_mapping.xml:188#, no-c-formatmsgid """<literal>mutable</literal> (optional - defaults to <literal>true</literal>): ""A value of <literal>false</literal> specifies that the elements of the ""collection never change (a minor performance optimization in some cases)."msgstr """<literal>mutable</literal> (optional - defaults to <literal>true</literal>): ""A value of <literal>false</literal> specifies that the elements of the ""collection never change (a minor performance optimization in some cases)."#. Tag: title#: collection_mapping.xml:198#, no-c-formatmsgid "Collection foreign keys"msgstr "Collection foreign keys"#. Tag: para#: collection_mapping.xml:200#, no-c-formatmsgid """Collection instances are distinguished in the database by the foreign key of ""the entity that owns the collection. This foreign key is referred to as the ""<emphasis>collection key column</emphasis> (or columns) of the collection ""table. The collection key column is mapped by the <literal><key></""literal> element."msgstr """Collection instances are distinguished in the database by the foreign key of ""the entity that owns the collection. This foreign key is referred to as the ""<emphasis>collection key column</emphasis> (or columns) of the collection ""table. The collection key column is mapped by the <literal><key></""literal> element."#. Tag: para#: collection_mapping.xml:208#, no-c-formatmsgid """There may be a nullability constraint on the foreign key column. For most ""collections, this is implied. For unidirectional one to many associations, ""the foreign key column is nullable by default, so you might need to specify ""<literal>not-null=\"true\"</literal>."msgstr """There may be a nullability constraint on the foreign key column. For most ""collections, this is implied. For unidirectional one to many associations, ""the foreign key column is nullable by default, so you might need to specify ""<literal>not-null=\"true\"</literal>."#. Tag: programlisting#: collection_mapping.xml:215#, no-c-formatmsgid "<![CDATA[<key column=\"productSerialNumber\" not-null=\"true\"/>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:217#, no-c-formatmsgid """The foreign key constraint may use <literal>ON DELETE CASCADE</literal>."msgstr """The foreign key constraint may use <literal>ON DELETE CASCADE</literal>."#. Tag: programlisting#: collection_mapping.xml:221#, no-c-formatmsgid "<![CDATA[<key column=\"productSerialNumber\" on-delete=\"cascade\"/>]]>"msgstr ""#. Tag: para#: collection_mapping.xml:223#, no-c-formatmsgid """See the previous chapter for a full definition of the <literal><key></""literal> element."msgstr """See the previous chapter for a full definition of the <literal><key></""literal> element."#. Tag: title#: collection_mapping.xml:231#, no-c-formatmsgid "Collection elements"msgstr "Collection elements"#. Tag: para#: collection_mapping.xml:233#, no-c-formatmsgid """Collections may contain almost any other Hibernate type, including all basic ""types, custom types, components, and of course, references to other ""entities. This is an important distinction: an object in a collection might ""be handled with \"value\" semantics (its life cycle fully depends on the ""collection owner) or it might be a reference to another entity, with its own ""life cycle. In the latter case, only the \"link\" between the two objects is ""considered to be state held by the collection."msgstr """Collections may contain almost any other Hibernate type, including all basic ""types, custom types, components, and of course, references to other ""entities. This is an important distinction: an object in a collection might ""be handled with \"value\" semantics (its life cycle fully depends on the ""collection owner) or it might be a reference to another entity, with its own ""life cycle. In the latter case, only the \"link\" between the two objects is ""considered to be state held by the collection."#. Tag: para#: collection_mapping.xml:242#, no-c-formatmsgid """The contained type is referred to as the <emphasis>collection element type</""emphasis>. Collection elements are mapped by <literal><element></""literal> or <literal><composite-element></literal>, or in the case of ""entity references, with <literal><one-to-many></literal> or ""<literal><many-to-many></literal>. The first two map elements with ""value semantics, the next two are used to map entity associations."msgstr """The contained type is referred to as the <emphasis>collection element type</""emphasis>. Collection elements are mapped by <literal><element></""literal> or <literal><composite-element></literal>, or in the case of ""entity references, with <literal><one-to-many></literal> or ""<literal><many-to-many></literal>. The first two map elements with ""value semantics, the next two are used to map entity associations."#. Tag: title#: collection_mapping.xml:254#, no-c-formatmsgid "Indexed collections"msgstr "Indexed collections"#. Tag: para#: collection_mapping.xml:256#, no-c-formatmsgid """All collection mappings, except those with set and bag semantics, need an ""<emphasis>index column</emphasis> in the collection table - a column that ""maps to an array index, or <literal>List</literal> index, or <literal>Map</""literal> key. The index of a <literal>Map</literal> may be of any basic ""type, mapped with <literal><map-key></literal>, it may be an entity ""reference mapped with <literal><map-key-many-to-many></literal>, or it ""may be a composite type, mapped with <literal><composite-map-key></""literal>. The index of an array or list is always of type <literal>integer</""literal> and is mapped using the <literal><list-index></literal> ""element. The mapped column contains sequential integers (numbered from zero, ""by default)."msgstr """All collection mappings, except those with set and bag semantics, need an ""<emphasis>index column</emphasis> in the collection table - a column that ""maps to an array index, or <literal>List</literal> index, or <literal>Map</""literal> key. The index of a <literal>Map</literal> may be of any basic ""type, mapped with <literal><map-key></literal>, it may be an entity ""reference mapped with <literal><map-key-many-to-many></literal>, or it ""may be a composite type, mapped with <literal><composite-map-key></""literal>. The index of an array or list is always of type <literal>integer</""literal> and is mapped using the <literal><list-index></literal> ""element. The mapped column contains sequential integers (numbered from zero, ""by default)."#. Tag: sect2#: collection_mapping.xml:267#, no-c-formatmsgid """<programlistingco> <areaspec> <area id=\"index1\" coords=\"2 45\"/> <area id=""\"index2\" coords=\"3 45\"/> </areaspec> <programlisting><![CDATA[<list-""index \n"" column=\"column_name\"\n"" base=\"0|1|...\"/>]]></programlisting> <calloutlist> <callout ""arearefs=\"index1\"> <para> <literal>column_name</literal> (required): The ""name of the column holding the collection index values. </para> </callout> ""<callout arearefs=\"index1\"> <para> <literal>base</literal> (optional, ""defaults to <literal>0</literal>): The value of the index column that ""corresponds to the first element of the list or array. </para> </callout> </""calloutlist> </programlistingco> <programlistingco> <areaspec> <area id=""\"mapkey1\" coords=\"2 45\"/> <area id=\"mapkey2\" coords=\"3 45\"/> <area ""id=\"mapkey3\" coords=\"4 45\"/> </areaspec> <programlisting><![CDATA[<map-""key \n"" column=\"column_name\"\n"" formula=\"any SQL expression\"\n"" type=\"type_name\"\n"" node=\"@attribute-name\"\n"" length=\"N\"/>]]></programlisting> <calloutlist> <callout arearefs=""\"mapkey1\"> <para> <literal>column</literal> (optional): The name of the ""column holding the collection index values. </para> </callout> <callout ""arearefs=\"mapkey2\"> <para> <literal>formula</literal> (optional): A SQL ""formula used to evaluate the key of the map. </para> </callout> <callout ""arearefs=\"mapkey3\"> <para> <literal>type</literal> (reguired): The type of ""the map keys. </para> </callout> </calloutlist> </programlistingco> ""<programlistingco> <areaspec> <area id=\"indexmanytomany1\" coords=\"2 45\"/""> <area id=\"indexmanytomany2\" coords=\"3 45\"/> <area id=\"indexmanytomany3""\" coords=\"3 45\"/> </areaspec> <programlisting><![CDATA[<map-key-many-to-""many\n"" column=\"column_name\"\n"" formula=\"any SQL expression\"\n"" class=\"ClassName\"\n""/>]]></programlisting> <calloutlist> <callout arearefs=\"indexmanytomany1\"> ""<para> <literal>column</literal> (optional): The name of the foreign key ""column for the collection index values. </para> </callout> <callout arearefs=""\"indexmanytomany2\"> <para> <literal>formula</literal> (optional): A SQL ""formula used to evaluate the foreign key of the map key. </para> </callout> ""<callout arearefs=\"indexmanytomany3\"> <para> <literal>class</literal> ""(required): The entity class used as the map key. </para> </callout> </""calloutlist> </programlistingco>"msgstr ""#. Tag: para#: collection_mapping.xml:348#, no-c-formatmsgid """If your table doesn't have an index column, and you still wish to use ""<literal>List</literal> as the property type, you should map the property as ""a Hibernate <emphasis><bag></emphasis>. A bag does not retain its ""order when it is retrieved from the database, but it may be optionally ""sorted or ordered."msgstr """If your table doesn't have an index column, and you still wish to use ""<literal>List</literal> as the property type, you should map the property as ""a Hibernate <emphasis><bag></emphasis>. A bag does not retain its ""order when it is retrieved from the database, but it may be optionally ""sorted or ordered."#. Tag: para#: collection_mapping.xml:357#, no-c-formatmsgid """There are quite a range of mappings that can be generated for collections, ""covering many common relational models. We suggest you experiment with the ""schema generation tool to get a feeling for how various mapping declarations ""translate to database tables."msgstr """There are quite a range of mappings that can be generated for collections, ""covering many common relational models. We suggest you experiment with the ""schema generation tool to get a feeling for how various mapping declarations ""translate to database tables."#. Tag: title#: collection_mapping.xml:364#, no-c-formatmsgid "Collections of values and many-to-many associations"msgstr "Collections of values and many-to-many associations"#. Tag: para#: collection_mapping.xml:366#, no-c-formatmsgid """Any collection of values or many-to-many association requires a dedicated ""<emphasis>collection table</emphasis> with a foreign key column or columns, ""<emphasis>collection element column</emphasis> or columns and possibly an ""index column or columns."msgstr """Any collection of values or many-to-many association requires a dedicated ""<emphasis>collection table</emphasis> with a foreign key column or columns, ""<emphasis>collection element column</emphasis> or columns and possibly an ""index column or columns."#. Tag: para#: collection_mapping.xml:373#, no-c-formatmsgid """For a collection of values, we use the <literal><element></literal> ""tag."msgstr """For a collection of values, we use the <literal><element></literal> ""tag."#. Tag: sect2#: collection_mapping.xml:375#, no-c-formatmsgid """<programlistingco> <areaspec> <area id=\"element1b\" coords=\"2 50\"/> <area ""id=\"element2b\" coords=\"3 50\"/> <area id=\"element3b\" coords=\"4 50\"/> ""</areaspec> <programlisting><![CDATA[<element\n"" column=\"column_name\"\n"" formula=\"any SQL expression\"\n"" type=\"typename\"\n"" length=\"L\"\n"" precision=\"P\"\n"" scale=\"S\"\n"" not-null=\"true|false\"\n"" unique=\"true|false\"\n"" node=\"element-name\"\n""/>]]></programlisting> <calloutlist> <callout arearefs=\"element1b\"> <para> ""<literal>column</literal> (optional): The name of the column holding the ""collection element values. </para> </callout> <callout arearefs=\"element2b""\"> <para> <literal>formula</literal> (optional): An SQL formula used to ""evaluate the element. </para> </callout> <callout arearefs=\"element3b\"> ""<para> <literal>type</literal> (required): The type of the collection ""element. </para> </callout> </calloutlist> </programlistingco> <para> A ""<emphasis>many-to-many association</emphasis> is specified using the ""<literal><many-to-many></literal> element. </para> <programlistingco> ""<areaspec> <area id=\"manytomany1\" coords=\"2 60\"/> <area id=\"manytomany2""\" coords=\"3 60\"/> <area id=\"manytomany3\" coords=\"4 60\"/> <area id=""\"manytomany4\" coords=\"5 60\"/> <area id=\"manytomany5\" coords=\"6 60\"/> ""<area id=\"manytomany6\" coords=\"7 60\"/> <area id=\"manytomany7\" coords=""\"8 60\"/> <area id=\"manytomany8\" coords=\"9 60\"/> </areaspec> ""<programlisting><![CDATA[<many-to-many\n"" 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><many-to-many></""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:480#, no-c-format
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -