📄 basic_mapping.pot
字号:
msgid "<literal>unique</literal> (optional): Enable the DDL generation of a unique constraint for the foreign-key column. Also, allow this to be the target of a <literal>property-ref</literal>. This makes the association multiplicity effectively one to one."msgstr ""#: basic_mapping.xml:1789(para) msgid "<literal>not-null</literal> (optional): Enable the DDL generation of a nullability constraint for the foreign key columns."msgstr ""#: basic_mapping.xml:1795(para) msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): Specifies that updates to this property do or do not require acquisition of the optimistic lock. In other words, dertermines if a version increment should occur when this property is dirty."msgstr ""#: basic_mapping.xml:1803(para) msgid "<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): By default, single point associations are proxied. <literal>lazy=\"no-proxy\"</literal> specifies that the property should be fetched lazily when the instance variable is first accessed (requires build-time bytecode instrumentation). <literal>lazy=\"false\"</literal> specifies that the association will always be eagerly fetched."msgstr ""#: basic_mapping.xml:1813(para) msgid "<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."msgstr ""#: basic_mapping.xml:1820(para) basic_mapping.xml:1988(para) msgid "<literal>entity-name</literal> (optional): The entity name of the associated class."msgstr ""#: basic_mapping.xml:1826(para) msgid "<literal>formula</literal> (optional): an SQL expression that defines the value for a <emphasis>computed</emphasis> foreign key."msgstr ""#: basic_mapping.xml:1833(para) msgid "Setting a value of the <literal>cascade</literal> attribute to any meaningful value other than <literal>none</literal> will propagate certain operations to the associated object. The meaningful values are the names of Hibernate's basic operations, <literal>persist, merge, delete, save-update, evict, replicate, lock, refresh</literal>, as well as the special values <literal>delete-orphan</literal> and <literal>all</literal> and comma-separated combinations of operation names, for example, <literal>cascade=\"persist,merge,evict\"</literal> or <literal>cascade=\"all,delete-orphan\"</literal>. See <xref linkend=\"objectstate-transitive\"/> for a full explanation. Note that single valued associations (many-to-one and one-to-one associations) do not support orphan delete."msgstr ""#: basic_mapping.xml:1846(para) msgid "A typical <literal>many-to-one</literal> declaration looks as simple as this:"msgstr ""#: basic_mapping.xml:1852(para) msgid "The <literal>property-ref</literal> attribute should only be used for mapping legacy data where a foreign key refers to a unique key of the associated table other than the primary key. This is an ugly relational model. For example, suppose the <literal>Product</literal> class had a unique serial number, that is not the primary key. (The <literal>unique</literal> attribute controls Hibernate's DDL generation with the SchemaExport tool.)"msgstr ""#: basic_mapping.xml:1863(para) msgid "Then the mapping for <literal>OrderItem</literal> might use:"msgstr ""#: basic_mapping.xml:1869(para) msgid "This is certainly not encouraged, however."msgstr ""#: basic_mapping.xml:1873(para) msgid "If the referenced unique key comprises multiple properties of the associated entity, you should map the referenced properties inside a named <literal><properties></literal> element."msgstr ""#: basic_mapping.xml:1878(para) msgid "If the referenced unique key is the property of a component, you may specify a property path:"msgstr ""#: basic_mapping.xml:1887(title) msgid "one-to-one"msgstr ""#: basic_mapping.xml:1889(para) msgid "A one-to-one association to another persistent class is declared using a <literal>one-to-one</literal> element."msgstr ""#: basic_mapping.xml:1935(para) msgid "<literal>cascade</literal> (optional) specifies which operations should be cascaded from the parent object to the associated object."msgstr ""#: basic_mapping.xml:1941(para) msgid "<literal>constrained</literal> (optional) specifies that a foreign key constraint on the primary key of the mapped table references the table of the associated class. This option affects the order in which <literal>save()</literal> and <literal>delete()</literal> are cascaded, and determines whether the association may be proxied (it is also used by the schema export tool)."msgstr ""#: basic_mapping.xml:1956(para) msgid "<literal>property-ref</literal>: (optional) The name of a property of the associated class that is joined to the primary key of this class. If not specified, the primary key of the associated class is used."msgstr ""#: basic_mapping.xml:1969(para) msgid "<literal>formula</literal> (optional): Almost all one to one associations map to the primary key of the owning entity. In the rare case that this is not the case, you may specify a some other column, columns or expression to join on using an SQL formula. (See <literal>org.hibernate.test.onetooneformula</literal> for an example.)"msgstr ""#: basic_mapping.xml:1977(para) msgid "<literal>lazy</literal> (optional - defaults to <literal>proxy</literal>): By default, single point associations are proxied. <literal>lazy=\"no-proxy\"</literal> specifies that the property should be fetched lazily when the instance variable is first accessed (requires build-time bytecode instrumentation). <literal>lazy=\"false\"</literal> specifies that the association will always be eagerly fetched. <emphasis>Note that if <literal>constrained=\"false\"</literal>, proxying is impossible and Hibernate will eager fetch the association!</emphasis>"msgstr ""#: basic_mapping.xml:1995(para) msgid "There are two varieties of one-to-one association:"msgstr ""#: basic_mapping.xml:1999(para) msgid "primary key associations"msgstr ""#: basic_mapping.xml:2002(para) msgid "unique foreign key associations"msgstr ""#: basic_mapping.xml:2007(para) msgid "Primary key associations don't need an extra table column; if two rows are related by the association then the two table rows share the same primary key value. So if you want two objects to be related by a primary key association, you must make sure that they are assigned the same identifier value!"msgstr ""#: basic_mapping.xml:2014(para) msgid "For a primary key association, add the following mappings to <literal>Employee</literal> and <literal>Person</literal>, respectively."msgstr ""#: basic_mapping.xml:2022(para) msgid "Now we must ensure that the primary keys of related rows in the PERSON and EMPLOYEE tables are equal. We use a special Hibernate identifier generation strategy called <literal>foreign</literal>:"msgstr ""#: basic_mapping.xml:2040(para) msgid "A newly saved instance of <literal>Person</literal> is then assigned the same primary key value as the <literal>Employee</literal> instance refered with the <literal>employee</literal> property of that <literal>Person</literal>."msgstr ""#: basic_mapping.xml:2046(para) msgid "Alternatively, a foreign key with a unique constraint, from <literal>Employee</literal> to <literal>Person</literal>, may be expressed as:"msgstr ""#: basic_mapping.xml:2053(para) msgid "And this association may be made bidirectional by adding the following to the <literal>Person</literal> mapping:"msgstr ""#: basic_mapping.xml:2063(title) msgid "natural-id"msgstr ""#: basic_mapping.xml:2071(para) msgid "Even though we recommend the use of surrogate keys as primary keys, you should still try to identify natural keys for all entities. A natural key is a property or combination of properties that is unique and non-null. If it is also immutable, even better. Map the properties of the natural key inside the <literal><natural-id></literal> element. Hibernate will generate the necessary unique key and nullability constraints, and your mapping will be more self-documenting."msgstr ""#: basic_mapping.xml:2080(para) msgid "We strongly recommend that you implement <literal>equals()</literal> and <literal>hashCode()</literal> to compare the natural key properties of the entity."msgstr ""#: basic_mapping.xml:2085(para) msgid "This mapping is not intended for use with entities with natural primary keys."msgstr ""#: basic_mapping.xml:2091(para) msgid "<literal>mutable</literal> (optional, defaults to <literal>false</literal>): By default, natural identifier properties as assumed to be immutable (constant)."msgstr ""#: basic_mapping.xml:2101(title) msgid "component, dynamic-component"msgstr ""#: basic_mapping.xml:2103(para) msgid "The <literal><component></literal> element maps properties of a child object to columns of the table of a parent class. Components may, in turn, declare their own properties, components or collections. See \"Components\" below."msgstr ""#: basic_mapping.xml:2144(para) msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): The name of the component (child) class."msgstr ""#: basic_mapping.xml:2150(para) basic_mapping.xml:2250(para) msgid "<literal>insert</literal>: Do the mapped columns appear in SQL <literal>INSERT</literal>s?"msgstr ""#: basic_mapping.xml:2156(para) basic_mapping.xml:2256(para) msgid "<literal>update</literal>: Do the mapped columns appear in SQL <literal>UPDATE</literal>s?"msgstr ""#: basic_mapping.xml:2168(para) msgid "<literal>lazy</literal> (optional - defaults to <literal>false</literal>): Specifies that this component should be fetched lazily when the instance variable is first accessed (requires build-time bytecode instrumentation)."msgstr ""#: basic_mapping.xml:2175(para) msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): Specifies that updates to this component do or do not require acquisition of the optimistic lock. In other words, determines if a version increment should occur when this property is dirty."msgstr ""#: basic_mapping.xml:2183(para) basic_mapping.xml:2270(para) msgid "<literal>unique</literal> (optional - defaults to <literal>false</literal>): Specifies that a unique constraint exists upon all mapped columns of the component."msgstr ""#: basic_mapping.xml:2192(para) msgid "The child <literal><property></literal> tags map properties of the child class to table columns."msgstr ""#: basic_mapping.xml:2197(para) msgid "The <literal><component></literal> element allows a <literal><parent></literal> subelement that maps a property of the component class as a reference back to the containing entity."msgstr ""#: basic_mapping.xml:2203(para) msgid "The <literal><dynamic-component></literal> element allows a <literal>Map</literal> to be mapped as a component, where the property names refer to keys of the map, see <xref linkend=\"components-dynamic\"/>."msgstr ""#: basic_mapping.xml:2212(title) msgid "properties"msgstr ""#: basic_mapping.xml:2214(para) msgid "The <literal><properties></literal> element allows the definition of a named, logical grouping of properties of a class. The most important use of the construct is that it allows a combination of properties to be the target of a <literal>property-ref</literal>. It is also a convenient way to define a multi-column unique constraint."msgstr ""#: basic_mapping.xml:2244(para) msgid "<literal>name</literal>: The logical name of the grouping - <emphasis>not</emphasis> an actual property name."msgstr ""#: basic_mapping.xml:2262(para) msgid "<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>): Specifies that updates to these properties do or do not require acquisition of the optimistic lock. In other words, determines if a version increment should occur when these properties are dirty."msgstr ""#: basic_mapping.xml:2279(para) msgid "For example, if we have the following <literal><properties></literal> mapping:"msgstr ""#: basic_mapping.xml:2294(para) msgid "Then we might have some legacy data association which refers to this unique key of the <literal>Person</literal> table, instead of to the primary key:"msgstr ""#: ba
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -