Top Description Methods
org.hibernate.id

public Interface UUIDGenerationStrategy

extends Serializable
Known Direct Implementers
org.hibernate.id.uuid.CustomVersionOneStrategy, org.hibernate.id.uuid.StandardRandomStrategy
Annotations
@Deprecated
since:6.0
Imports
java.io.Serializable, java.util.UUID, org.hibernate.engine.spi.SharedSessionContractImplementor

Deprecated

since 6.0.

see UUIDGenerator

A strategy for generating a variant 2 UUID value.

Method Summary

Modifier and TypeMethod and Description
public UUID

Returns:

The generated UUID.
generateUUID
(SharedSessionContractImplementor
The session asking for the generation
session
)

Generate the UUID.

public int

Returns:

The supported generation version
getGeneratedVersion
()

Which variant, according to IETF RFC 4122, of UUID does this strategy generate?

Method Detail

generateUUIDback to summary
public UUID generateUUID(SharedSessionContractImplementor session)

Generate the UUID.

Parameters
session:SharedSessionContractImplementor

The session asking for the generation

Returns:UUID

The generated UUID.

getGeneratedVersionback to summary
public int getGeneratedVersion()

Which 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)

Returning the values above should be reserved to those generators creating variants compliant with the corresponding RFC definition; others can feel free to return other values as they see fit.

Informational only, and not used at this time.

Returns:int

The supported generation version