File tree 2 files changed +27
-1
lines changed
api/src/main/java/jakarta/persistence 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -163,4 +163,17 @@ public interface PersistenceUnitUtil extends PersistenceUtil {
163
163
* to be an entity
164
164
*/
165
165
public Object getIdentifier (Object entity );
166
- }
166
+
167
+ /**
168
+ * Return the version of the entity.
169
+ * A generated version is not guaranteed to be available until after
170
+ * the database insert has occurred.
171
+ * Returns null if the entity does not yet have an id.
172
+ * @param entity entity instance
173
+ * @return id of the entity
174
+ * @throws IllegalArgumentException if the object is found not
175
+ * to be an entity
176
+ * @since 3.2
177
+ */
178
+ public Object getVersion (Object entity );
179
+ }
Original file line number Diff line number Diff line change @@ -1524,5 +1524,18 @@ public interface PersistenceUnitUtil extends PersistenceUtil {
1524
1524
* to be an entity
1525
1525
*/
1526
1526
public Object getIdentifier(Object entity);
1527
+
1528
+ /**
1529
+ * Return the version of the entity.
1530
+ * A generated version is not guaranteed to be available until after
1531
+ * the database insert has occurred.
1532
+ * Returns null if the entity does not yet have an id.
1533
+ * @param entity entity instance
1534
+ * @return id of the entity
1535
+ * @throws IllegalArgumentException if the object is found not
1536
+ * to be an entity
1537
+ * @since 3.2
1538
+ */
1539
+ public Object getVersion(Object entity);
1527
1540
}
1528
1541
----
You can’t perform that action at this time.
0 commit comments