Skip to content

Commit e44c59b

Browse files
committed
HHH-18377 Fixed Javadoc comments
1 parent 838261a commit e44c59b

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

hibernate-core/src/main/java/org/hibernate/id/uuid/UuidV6ValueGenerator.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@
2020
import org.hibernate.id.UUIDGenerationStrategy;
2121

2222
/**
23-
* Implements a <a href="https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-6">UUID Version 6</a> generation strategy as defined by the {@link UUID#randomUUID()} method.
23+
* Implements UUID Version 6 generation strategy as defined by the <a href="https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-6">RFC 9562</a>.
24+
*
25+
* <ul>
26+
* <li>32 bits - the most significant 32 bits of the 60-bit starting timestamp.</li>
27+
* <li>16 bits - the middle 16 bits of the 60-bit starting timestamp.</li>
28+
* <li>4 bits - version field, set to 0b0110 (6).</li>
29+
* <li>12 bits - the least significant 12 bits from the 60-bit starting timestamp.</li>
30+
* <li>2 bits - variant field, set to 0b10.</li>
31+
* <li>14 bits - the clock sequence, resets to 0 when timestamp changes. </li>
32+
* <li>48 bits - pseudorandom data to provide uniqueness.</li>
33+
* </ul>
2434
*
2535
* @author Cedomir Igaly
2636
*/
@@ -66,7 +76,7 @@ public int getGeneratedVersion() {
6676
}
6777

6878
/**
69-
* Delegates to {@link UUID#randomUUID()}
79+
* Delegates to {@link #generateUuid}
7080
*/
7181
@Override
7282
public UUID generateUUID(SharedSessionContractImplementor session) {
@@ -75,16 +85,6 @@ public UUID generateUUID(SharedSessionContractImplementor session) {
7585

7686

7787
/**
78-
* <ul>
79-
* <li>32 bits - the most significant 32 bits of the 60-bit starting timestamp.</li>
80-
* <li>16 bits - the middle 16 bits of the 60-bit starting timestamp.</li>
81-
* <li>4 bits - version field, set to 0b0110 (6).</li>
82-
* <li>12 bits - the least significant 12 bits from the 60-bit starting timestamp.</li>
83-
* <li>2 bits - variant field, set to 0b10.</li>
84-
* <li>14 bits - the clock sequence, resets to 0 when timestamp changes. </li>
85-
* <li>48 bits - pseudorandom data to provide uniqueness.</li>
86-
* </ul>
87-
*
8888
* @param session session
8989
*
9090
* @return UUID version 6

hibernate-core/src/main/java/org/hibernate/id/uuid/UuidV7ValueGenerator.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,19 @@
2121
import static java.time.temporal.ChronoUnit.MILLIS;
2222

2323
/**
24-
* Implements a <a href="https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7">UUID Version 7</a> generation strategy as defined by the {@link UUID#randomUUID()} method.
24+
* Implements UUID Version 7 generation strategy as defined by the <a href="https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7">RFC 9562</a>.
25+
*
26+
* <ul>
27+
* <li>48 bits - 48-bit big-endian unsigned number of the Unix Epoch timestamp in milliseconds.</li>
28+
* <li>4 bits - version field, set to 0b0111 (7).</li>
29+
* <li>
30+
* 12 bits - sub-milliseconds part of timestamp (resolution approximately 1/4 of millisecond)
31+
* to guarantee additional monotonicity.
32+
* </li>
33+
* <li>2 bits - variant field, set to 0b10.</li>
34+
* <li>14 bits - counter to guarantee additional monotonicity, resets to 0 when timestamp changes. </li>
35+
* <li>48 bits - pseudorandom data to provide uniqueness.</li>
36+
* </ul>
2537
*
2638
* @author Cedomir Igaly
2739
*/
@@ -63,26 +75,14 @@ public int getGeneratedVersion() {
6375
}
6476

6577
/**
66-
* Delegates to {@link UUID#randomUUID()}
78+
* Delegates to {@link #generateUuid}
6779
*/
6880
@Override
6981
public UUID generateUUID(SharedSessionContractImplementor session) {
7082
return generateUuid( session );
7183
}
7284

7385
/**
74-
* <ul>
75-
* <li>48 bits - 48-bit big-endian unsigned number of the Unix Epoch timestamp in milliseconds.</li>
76-
* <li>4 bits - version field, set to 0b0111 (7).</li>
77-
* <li>
78-
* 12 bits - sub-milliseconds part of timestamp (resolution approximately 1/4 of millisecond)
79-
* to guarantee additional monotonicity.
80-
* </li>
81-
* <li>2 bits - variant field, set to 0b10.</li>
82-
* <li>14 bits - counter to guarantee additional monotonicity, resets to 0 when timestamp changes. </li>
83-
* <li>48 bits - pseudorandom data to provide uniqueness.</li>
84-
* </ul>
85-
*
8686
* @param session session
8787
*
8888
* @return UUID version 7

0 commit comments

Comments
 (0)