Skip to content

Commit bcfcef3

Browse files
committed
specify that SEQUENCE, TABLE, UUID generated ids are available in @PrePersist
see jakartaee#133
1 parent 42155f8 commit bcfcef3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spec/src/main/asciidoc/ch03-entity-operations.adoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,8 +2543,11 @@ callback methods will be invoked for the managed instance after the
25432543
entity state has been copied to it. These _PrePersist_ and _PreRemove_
25442544
callbacks will also be invoked on all entities to which these operations
25452545
are cascaded. The _PrePersist_ and _PreRemove_ methods will always be
2546-
invoked as part of the synchronous persist, merge, and remove
2547-
operations.
2546+
invoked as part of the synchronous persist, merge, and remove operations.
2547+
Primary key values generated using the _SEQUENCE_, _TABLE_, or _UUID_
2548+
strategy are available in the _PrePersist_ method. Primary key values
2549+
generated using the _IDENTITY_ strategy are not available in the
2550+
_PrePersist_ method.
25482551

25492552
The _PostPersist_ and _PostRemove_ callback
25502553
methods are invoked for an entity after the entity has been made
@@ -2555,7 +2558,7 @@ delete operations respectively. These database operations may occur
25552558
directly after the persist, merge, or remove operations have been
25562559
invoked or they may occur directly after a flush operation has occurred
25572560
(which may be at the end of the transaction). Generated primary key
2558-
values are available in the _PostPersist_ method.
2561+
values are always available in the _PostPersist_ method.
25592562

25602563
The _PreUpdate_ and _PostUpdate_ callbacks
25612564
occur before and after the database update operations to entity data

0 commit comments

Comments
 (0)