Class Overview
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 legacy UUIDHexGenerator
id 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.
Summary
Public Methods |
static
long
|
generateLeastSignificantBits(long seed)
|
UUID
|
generateUUID(SessionImplementor session)
Generate the UUID.
|
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.
|
long
|
getMostSignificantBits()
|
static
void
|
main(String[] args)
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
From interface
org.hibernate.id.UUIDGenerationStrategy
abstract
UUID
|
generateUUID(SessionImplementor session)
Generate the UUID.
|
abstract
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.
|
|
Public Constructors
public
CustomVersionOneStrategy
()
Public Methods
public
static
long
generateLeastSignificantBits
(long seed)
Parameters
session
| The session asking for the generation |
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
- The supported generation version
public
long
getMostSignificantBits
()