类 CustomVersionOneStrategy
- java.lang.Object
-
- org.hibernate.id.uuid.CustomVersionOneStrategy
-
- 所有已实现的接口:
Serializable,UUIDGenerationStrategy
public class CustomVersionOneStrategy extends Object implements UUIDGenerationStrategy
Applies a version 1 (time-based) generation strategy (using ip address rather than mac address) but applies them in a different layout. The strategy is very similar to the legacyUUIDHexGeneratorid generator but uses a RFC 4122 compliant layout (variant 2). NOTE : Can be a bottle neck due to the need to synchronize in order to increment an internal count as part of the algorithm.- 作者:
- Steve Ebersole
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 CustomVersionOneStrategy()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static longgenerateLeastSignificantBits(long seed)UUIDgenerateUUID(SharedSessionContractImplementor session)Generate the UUID.intgetGeneratedVersion()Which variant, according to IETF RFC 4122, of UUID does this strategy generate?longgetMostSignificantBits()static voidmain(String[] args)
-
-
-
方法详细资料
-
getGeneratedVersion
public int getGeneratedVersion()
从接口复制的说明:UUIDGenerationStrategyWhich variant, according to IETF RFC 4122, of UUID does this strategy generate? RFC 4122 defines 5 variants (though it only describes algorithms to generate 4):- 1 = time based
- 2 = DCE based using POSIX UIDs
- 3 = name based (md5 hash)
- 4 = random numbers based
- 5 = name based (sha-1 hash)
- 指定者:
getGeneratedVersion在接口中UUIDGenerationStrategy- 返回:
- The supported generation version
-
generateUUID
public UUID generateUUID(SharedSessionContractImplementor session)
从接口复制的说明:UUIDGenerationStrategyGenerate the UUID.- 指定者:
generateUUID在接口中UUIDGenerationStrategy- 参数:
session- The session asking for the generation- 返回:
- The generated UUID.
-
getMostSignificantBits
public long getMostSignificantBits()
-
generateLeastSignificantBits
public static long generateLeastSignificantBits(long seed)
-
main
public static void main(String[] args)
-
-