Session to the persistent object.
Persistent classes may implement this interface but they are not
required to.
Session.update() is called
onLoad() may be used to initialize transient properties of the
object from its persistent state. It may not be used to load
dependent objects since the Session interface may not be
invoked from inside this method.
A further intended usage of onLoad(), onSave() and
onUpdate() is to store a reference to the Session
for later use.
If onSave(), onUpdate() or onDelete() return
VETO, the operation is silently vetoed. If a
CallbackException is thrown, the operation is vetoed and the
exception is passed back to the application.
Note that onSave() is called after an identifier is assigned
to the object, except when identity column key generation is used.
CallbackException, jakarta.persistence.EntityListeners , jakarta.persistence.PrePersist , jakarta.persistence.PreRemove , jakarta.persistence.PreUpdate , jakarta.persistence.PostLoad , jakarta.persistence.PostPersist , jakarta.persistence.PostRemove , jakarta.persistence.PostUpdate
| Modifier and Type | Field and Description |
|---|---|
| public static final boolean | NO_VETO
Return value to accept the action (false) |
| public static final boolean | VETO
Return value to veto the action (true) |
| Modifier and Type | Method and Description |
|---|---|
| public default boolean | |
| public default void | |
| public default void | onLoad(Session
the session s, Serializable the identifier id)
Deprecated
since 6.0. use
Called after an entity is loaded.
onLoad(Session, Object)
|
| public default boolean | |
| public default boolean |
| NO_VETO | back to summary |
|---|---|
| public static final boolean NO_VETO Return value to accept the action (false) | |
| VETO | back to summary |
|---|---|
| public static final boolean VETO Return value to veto the action (true) | |
| onDelete | back to summary |
|---|---|
| public default boolean onDelete(Session s) throws CallbackException Called when an entity is deleted.
| |
| onLoad | back to summary |
|---|---|
| public default void onLoad(Session s, Object id) Called after an entity is loaded. It is illegal to
access the | |
| onLoad | back to summary |
|---|---|
| public default void onLoad(Session s, Serializable id)
Called after an entity is loaded. It is illegal to
access the
| |
| onSave | back to summary |
|---|---|
| public default boolean onSave(Session s) throws CallbackException Called when an entity is saved.
| |
| onUpdate | back to summary |
|---|---|
| public default boolean onUpdate(Session s) throws CallbackException Called when an entity is passed to
| |