时间:2021-07-01 10:21:17 帮助过:2人阅读
generates identifiers of type long
, short
or int
that are unique only when no other process is inserting data into the same table. Do not use in a cluster.
identity
supports identity columns in DB2, MySQL, MS SQLServer, Sybase and HypersonicSQL. The returned identifier is of type long
, short
or int
.
sequence
uses a sequence in DB2, PostgreSQL, Oracle, SAP DB, McKoi or a generator in Interbase. The returned identifier is of type long
, short
or int
uuid
Generates a 128-bit UUID based on a custom algorithm. The value generated is represented as a string of 32 hexidecimal digits. Users can also configure it to use a separator (config parameter "separator") which separates the hexidecimal digits into 8{sep}8{sep}4{sep}8{sep}4.
uuid2
Generates a IETF RFC 4122 compliant (variant 2) 128-bit UUID. The exact "version" (the RFC term) generated depends on the pluggable "generation strategy" used. Capable of generating values as java.util.UUID
, java.lang.String
or as a byte array of length 16 (byte[16]
). The "generation strategy" is defined by the interface org.hibernate.id.UUIDGenerationStrategy
.
guid
uses a database-generated GUID string on MS SQL Server and MySQL.
native
selects identity
,sequence
or hilo
depending upon the capabilities of the underlying database.
assigned
lets the application assign an identifier to the object before save()
is called. This is the default strategy if no <generator>
element is specified.
foreign
uses the identifier of another associated object. It is usually used in conjunction with a <one-to-one>
primary key association.
Oracle系列:(24)序列
标签:oracle