📄 basic_mapping.pot
字号:
#: basic_mapping.xml:844(title) msgid "UUID algorithm"msgstr ""#: basic_mapping.xml:845(para) msgid "The UUID contains: IP address, startup time of the JVM (accurate to a quarter second), system time and a counter value (unique within the JVM). It's not possible to obtain a MAC address or memory address from Java code, so this is the best we can do without using JNI."msgstr ""#: basic_mapping.xml:854(title) msgid "Identity columns and sequences"msgstr ""#: basic_mapping.xml:855(para) msgid "For databases which support identity columns (DB2, MySQL, Sybase, MS SQL), you may use <literal>identity</literal> key generation. For databases that support sequences (DB2, Oracle, PostgreSQL, Interbase, McKoi, SAP DB) you may use <literal>sequence</literal> style key generation. Both these strategies require two SQL queries to insert a new object."msgstr ""#: basic_mapping.xml:873(para) msgid "For cross-platform development, the <literal>native</literal> strategy will choose from the <literal>identity</literal>, <literal>sequence</literal> and <literal>hilo</literal> strategies, dependant upon the capabilities of the underlying database."msgstr ""#: basic_mapping.xml:882(title) msgid "Assigned identifiers"msgstr ""#: basic_mapping.xml:883(para) msgid "If you want the application to assign identifiers (as opposed to having Hibernate generate them), you may use the <literal>assigned</literal> generator. This special generator will use the identifier value already assigned to the object's identifier property. This generator is used when the primary key is a natural key instead of a surrogate key. This is the default behavior if you do no specify a <literal><generator></literal> element."msgstr ""#: basic_mapping.xml:892(para) msgid "Choosing the <literal>assigned</literal> generator makes Hibernate use <literal>unsaved-value=\"undefined\"</literal>, forcing Hibernate to go to the database to determine if an instance is transient or detached, unless there is a version or timestamp property, or you define <literal>Interceptor.isUnsaved()</literal>."msgstr ""#: basic_mapping.xml:902(title) msgid "Primary keys assigned by triggers"msgstr ""#: basic_mapping.xml:903(para) msgid "For legacy schemas only (Hibernate does not generate DDL with triggers)."msgstr ""#: basic_mapping.xml:913(para) msgid "In the above example, there is a unique valued property named <literal>socialSecurityNumber</literal> defined by the class, as a natural key, and a surrogate key named <literal>person_id</literal> whose value is generated by a trigger."msgstr ""#: basic_mapping.xml:925(title) msgid "Enhanced identifier generators"msgstr ""#: basic_mapping.xml:927(para) msgid "Starting with release 3.2.3, there are 2 new generators which represent a re-thinking of 2 different aspects of identifier generation. The first aspect is database portability; the second is optimization (not having to query the database for every request for a new identifier value). These two new generators are intended to take the place of some of the named generators described above (starting in 3.3.x); however, they are included in the current releases and can be referenced by FQN."msgstr ""#: basic_mapping.xml:949(para) msgid "<literal>sequence_name</literal> (optional, defaults to <literal>hibernate_sequence</literal>): The name of the sequence (or table) to be used."msgstr ""#: basic_mapping.xml:955(para) msgid "<literal>initial_value</literal> (optional, defaults to <literal>1</literal>): The initial value to be retrieved from the sequence/table. In sequence creation terms, this is analogous to the clause typical named \"STARTS WITH\"."msgstr ""#: basic_mapping.xml:962(para) msgid "<literal>increment_size</literal> (optional, defaults to <literal>1</literal>): The value by which subsequent calls to the sequence/table should differ. In sequence creation terms, this is analogous to the clause typical named \"INCREMENT BY\"."msgstr ""#: basic_mapping.xml:969(para) msgid "<literal>force_table_use</literal> (optional, defaults to <literal>false</literal>): Should we force the use of a table as the backing structure even though the dialect might support sequence?"msgstr ""#: basic_mapping.xml:976(para) msgid "<literal>value_column</literal> (optional, defaults to <literal>next_val</literal>): Only relevant for table structures! The name of the column on the table which is used to hold the value."msgstr ""#: basic_mapping.xml:983(para) msgid "<literal>optimizer</literal> (optional, defaults to <literal>none</literal>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>"msgstr ""#: basic_mapping.xml:935(para) msgid "The first of these new generators is <literal>org.hibernate.id.enhanced.SequenceStyleGenerator</literal> which is intended firstly as a replacement for the <literal>sequence</literal> generator and secondly as a better portability generator than <literal>native</literal> (because <literal>native</literal> (generally) chooses between <literal>identity</literal> and <literal>sequence</literal> which have largely different semantics which can cause subtle isssues in applications eyeing portability). <literal>org.hibernate.id.enhanced.SequenceStyleGenerator</literal> however achieves portability in a different manner. It chooses between using a table or a sequence in the database to store its incrementing values depending on the capabilities of the dialect being used. The difference between this and <literal>native</literal> is that table-based and sequence-based storage have the same exact semantic (in fact sequences are exactly what Hibernate tries to emmulate with its table-based generators). This generator has a number of configuration parameters: <placeholder-1/>"msgstr ""#: basic_mapping.xml:1000(para) msgid "<literal>table_name</literal> (optional, defaults to <literal>hibernate_sequences</literal>): The name of the table to be used."msgstr ""#: basic_mapping.xml:1006(para) msgid "<literal>value_column_name</literal> (optional, defaults to <literal>next_val</literal>): The name of the column on the table which is used to hold the value."msgstr ""#: basic_mapping.xml:1012(para) msgid "<literal>segment_column_name</literal> (optional, defaults to <literal>sequence_name</literal>): The name of the column on the table which is used to hold the \"segement key\". This is the value which distinctly identifies which increment value to use."msgstr ""#: basic_mapping.xml:1019(para) msgid "<literal>segment_value</literal> (optional, defaults to <literal>default</literal>): The \"segment key\" value for the segment from which we want to pull increment values for this generator."msgstr ""#: basic_mapping.xml:1026(para) msgid "<literal>segment_value_length</literal> (optional, defaults to <literal>255</literal>): Used for schema generation; the column size to create this segment key column."msgstr ""#: basic_mapping.xml:1032(para) msgid "<literal>initial_value</literal> (optional, defaults to <literal>1</literal>): The initial value to be retrieved from the table."msgstr ""#: basic_mapping.xml:1038(para) msgid "<literal>increment_size</literal> (optional, defaults to <literal>1</literal>): The value by which subsequent calls to the table should differ."msgstr ""#: basic_mapping.xml:1044(para) msgid "<literal>optimizer</literal> (optional, defaults to <literal/>): See <xref linkend=\"mapping-declaration-id-enhanced-optimizers\"/>"msgstr ""#: basic_mapping.xml:990(para) msgid "The second of these new generators is <literal>org.hibernate.id.enhanced.TableGenerator</literal> which is intended firstly as a replacement for the <literal>table</literal> generator (although it actually functions much more like <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal>) and secondly as a re-implementation of <literal>org.hibernate.id.MultipleHiLoPerTableGenerator</literal> utilizing the notion of pluggable optimiziers. Essentially this generator defines a table capable of holding a number of different increment values simultaneously by using multiple distinctly keyed rows. This generator has a number of configuration parameters: <placeholder-1/>"msgstr ""#: basic_mapping.xml:1054(title) msgid "Identifier generator optimization"msgstr ""#: basic_mapping.xml:1063(para) msgid "<literal>none</literal> (generally this is the default if no optimizer was specified): This says to not perform any optimizations, and hit the database each and every request."msgstr ""#: basic_mapping.xml:1069(para) msgid "<literal>hilo</literal>: applies a hi/lo algorithm around the database retrieved values. The values from the database for this optimizer are expected to be sequential. The values retrieved from the database structure for this optimizer indicates the \"group number\"; the <literal>increment_size</literal> is multiplied by that value in memory to define a group \"hi value\"."msgstr ""#: basic_mapping.xml:1078(para) msgid "<literal>pooled</literal>: like was discussed for <literal>hilo</literal>, this optimizers attempts to minimize the number of hits to the database. Here, however, we simply store the starting value for the \"next group\" into the database structure rather than a sequential value in combination with an in-memory grouping algorithm. <literal>increment_size</literal> here refers to the values coming from the database."msgstr ""#: basic_mapping.xml:1055(para) msgid "For identifier generators which store values in the database, it is inefficient for them to hit the database on each and every call to generate a new identifier value. Instead, you'd ideally want to group a bunch of them in memory and only hit the database when you have exhausted your in-memory value group. This is the role of the pluggable optimizers. Currently only the two enhanced generators (<xref linkend=\"mapping-declaration-id-enhanced\"/> support this notion. <placeholder-1/>"msgstr ""#: basic_mapping.xml:1091(title) msgid "composite-id"msgstr ""#: basic_mapping.xml:1105(para) msgid "For a table with a composite key, you may map multiple properties of the class as identifier properties. The <literal><composite-id></literal> element accepts <literal><key-property></literal> property mappings and <literal><key-many-to-one></literal> mappings as child elements."msgstr ""#: basic_mapping.xml:1117(para) msgid "Your persistent class <emphasis>must</emphasis> override <literal>equals()</literal> and <literal>hashCode()</literal> to implement composite identifier equality. It must also implements <literal>Serializable</literal>."msgstr ""#: basic_mapping.xml:1123(para) msgid "Unfortunately, this approach to composite identifiers means that a persistent object is its own identifier. There is no convenient \"handle\" other than the object itself. You must instantiate an instance of the persistent class itself and populate its identifier properties before you can <literal>load()</literal> the persistent state associated with a composite key. We call this approach an <emphasis>embedded</emphasis> composite identifier, and discourage it for serious applications."msgstr ""#: basic_mapping.xml:1132(para) msgid "A second approach is what we call a <emphasis>mapped</emphasis> composite identifier, where the identifier properties named inside the <literal><composite-id></literal> element are duplicated on both the persistent class and a separate identifier class."msgstr ""#: basic_mapping.xml:1143(para) msgid "In this example, both the composite identifier class, <literal>MedicareId</literal>, and the entity class itself have properties named <literal>medicareNumber</literal> and <literal>dependent</literal>. The identifier class must override <literal>equals()</literal> and <literal>hashCode()</literal> and implement. <literal>Serializable</literal>. The disadvantage of this approach is quite obvious—code duplication."msgstr ""#: basic_mapping.xml:1152(para) msgid "The following attributes are used to specify a mapped composite identifier:"msgstr ""#: basic_mapping.xml:1158(para) msgid "<literal>mapped</literal> (optional, defaults to <literal>false</literal>): indicates that a mapped composite identifier is used, and that the contained property mappings refer to both the entity class and the composite identifier class."msgstr ""#: basic_mapping.xml:1166(para) msgid "<literal>class</literal> (optional, but required for a mapped composite identifier): The class used as a composite identifier."msgstr ""#: basic_mapping.xml:1173(para) msgid "We will describe a third, even more convenient approach where the composite identifier is implemented as a component class in <xref linkend=\"components-compositeid\"/>. The attributes described below apply only to this alternative approach:"msgstr ""#: basic_mapping.xml:1181(para) msgid "<literal>name</literal> (optional, required for this approach): A property of component type that holds the composite identifier (see chapter 9)."msgstr ""#: basic_mapping.xml:1193(para) msgid "<literal>class</literal> (optional - defaults to the property type determined by reflection): The component class used as a composite identifier (see next section)."msgstr ""#: basic_mapping.xml:1200(para) msgid "This third approach, an <emphasis>identifier component</emphasis> is the one we recommend for almost all applications."msgstr ""#: basic_mapping.xml:1208(title) msgid "discriminator"msgstr ""#: basic_mapping.xml:1210(para) msgid "The <literal><discriminator></literal> element is required for polymorphic persistence using the table-per-class-hierarchy mapping strategy and declares a discriminator column of the table. The discriminator column contains marker values that tell the persistence layer what subclass to instantiate for a particular row. A restricted set of types may be used: <literal>string</literal>, <literal>character</literal>, <literal>integer</literal>, <literal>byte</literal>, <literal>short</literal>, <literal>boolean</literal>, <literal>yes_no</literal>, <literal>true_false</literal>."msgstr ""#: basic_mapping.xml:1237(para) msgid "<literal>column</literal> (optional - defaults to <literal>class</literal>) the name of the discriminator column."msgstr ""#: basic_mapping.xml:1243(para) msgid "<literal>type</literal> (optional - defaults to <literal>string</literal>) a name that indicates the Hibernate type"msgstr ""#: basic_mapping.xml:1249(para) msgid "<literal>force</literal> (optional - defaults to <literal>false</literal>) \"force\" Hibernate to specify allowed discriminator values even when retrieving all instances of the root class."msgstr ""#: basic_mapping.xml:1256(para) msgid "<literal>insert</literal> (optional - defaults to <literal>true</literal>) set this to <literal>false</literal> if your discriminator column is also part of a mapped composite identifier. (Tells Hibernate to not include the column in SQL <literal>INSERT</literal>s.)"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -