public interface SimpleNaturalIdLoadAccess<T>
NaturalId
,
NaturalIdLoadAccess
Modifier and Type | Method and Description |
---|---|
T |
getReference(Object naturalIdValue)
Return the persistent instance with the given natural id value, assuming that the instance exists.
|
T |
load(Object naturalIdValue)
Return the persistent instance with the given natural id value, or
null if there is no such persistent
instance. |
Optional<T> |
loadOptional(Serializable naturalIdValue)
Same semantic as
load(java.lang.Object) except that here Optional is returned to
handle nullability. |
SimpleNaturalIdLoadAccess<T> |
setSynchronizationEnabled(boolean enabled)
For entities with mutable natural ids, should Hibernate perform "synchronization" prior to performing
lookups? The default is to perform "synchronization" (for correctness).
|
SimpleNaturalIdLoadAccess<T> |
with(LockOptions lockOptions)
Specify the
LockOptions to use when retrieving the entity. |
SimpleNaturalIdLoadAccess<T> with(LockOptions lockOptions)
LockOptions
to use when retrieving the entity.lockOptions
- The lock options to use.this
, for method chainingSimpleNaturalIdLoadAccess<T> setSynchronizationEnabled(boolean enabled)
NaturalIdLoadAccess.setSynchronizationEnabled(boolean)
for detailed discussion.enabled
- Should synchronization be performed? true
indicates synchronization will be performed;
false
indicates it will be circumvented.this
, for method chainingT getReference(Object naturalIdValue)
load(java.lang.Object)
instead. Use this only to retrieve an instance that you assume exists, where non-existence would be an
actual error.naturalIdValue
- The value of the natural-id for the entity to retrievenull
.T load(Object naturalIdValue)
null
if there is no such persistent
instance. If the instance is already associated with the session, return that instance, initializing it if
needed. This method never returns an uninitialized instance.naturalIdValue
- The value of the natural-id for the entity to retrievenull
Optional<T> loadOptional(Serializable naturalIdValue)
load(java.lang.Object)
except that here Optional
is returned to
handle nullability.naturalIdValue
- The identifierCopyright © 2001-2022 Red Hat, Inc. All Rights Reserved.