Top Fields Constructors Methods
org.hibernate.loader.internal

public Class SimpleNaturalIdLoadAccessImpl<T>

extends BaseNaturalIdLoadAccessImpl<T>
implements SimpleNaturalIdLoadAccess<T>
Class Inheritance
All Implemented Interfaces
org.hibernate.SimpleNaturalIdLoadAccess
Imports
java.util.List, .Locale, .Map, .Optional, org.hibernate.HibernateException, .LockOptions, .SimpleNaturalIdLoadAccess, org.hibernate.graph.GraphSemantic, .RootGraph, org.hibernate.loader.LoaderLogging, org.hibernate.metamodel.mapping.EntityMappingType, org.hibernate.metamodel.mapping.internal.SimpleNaturalIdMapping

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SimpleNaturalIdLoadAccess<T>
disableFetchProfile(String profileName)

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.disableFetchProfile.

Implements org.hibernate.SimpleNaturalIdLoadAccess.disableFetchProfile.

Customize the associations fetched by specifying a fetch profile that should be disabled during this operation.
public SimpleNaturalIdLoadAccess<T>
enableFetchProfile(String profileName)

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.enableFetchProfile.

Implements org.hibernate.SimpleNaturalIdLoadAccess.enableFetchProfile.

Customize the associations fetched by specifying a fetch profile that should be enabled during this operation.
public LockOptions
public T
getReference(Object
The value of the natural id
naturalIdValue
)

Implements org.hibernate.SimpleNaturalIdLoadAccess.getReference.

Return the persistent instance with the given natural id value, assuming that the instance exists.
public boolean
public T
load(Object
The value of the natural-id
naturalIdValue
)

Implements org.hibernate.SimpleNaturalIdLoadAccess.load.

Return the persistent instance with the given natural id value, or null if there is no such persistent instance.
public Optional<T>
loadOptional(Object
The identifier
naturalIdValue
)

Implements org.hibernate.SimpleNaturalIdLoadAccess.loadOptional.

Just like load, except that here an Optional is returned.
public SimpleNaturalIdLoadAccessImpl<T>
setSynchronizationEnabled(boolean
Should synchronization be performed? true indicates synchronization will be performed; false indicates it will be circumvented.
synchronizationEnabled
)

Implements org.hibernate.SimpleNaturalIdLoadAccess.setSynchronizationEnabled.

For entities with mutable natural ids, should Hibernate perform "synchronization" prior to performing lookups?
private void
verifySimplicity(Object naturalIdValue)

public final SimpleNaturalIdLoadAccessImpl<T>
with(LockOptions
The lock options to use
lockOptions
)

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.with.

Implements org.hibernate.SimpleNaturalIdLoadAccess.with.

Specify the lock options to use when querying the database.
public SimpleNaturalIdLoadAccess<T>
with(RootGraph<T> graph, GraphSemantic semantic)

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.with.

Implements org.hibernate.SimpleNaturalIdLoadAccess.with.

Customize the associations fetched by specifying an entity graph, and how it should be interpreted.
public SimpleNaturalIdLoadAccess<T>
withLoadGraph(RootGraph<T> graph)

Overrides default org.hibernate.SimpleNaturalIdLoadAccess.withLoadGraph.

Augment the associations fetched by default by specifying a list of additional associations to be fetched as an entity graph.
Inherited from org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl:
doGetReferencedoLoadentityPersistergetContextgetEntityDescriptorgetIdentifierLoadAccessperformAnyNeededCrossReferenceSynchronizationssynchronizationEnabled

Field Detail

hasSimpleNaturalIdback to summary
private final boolean hasSimpleNaturalId

Constructor Detail

SimpleNaturalIdLoadAccessImplback to summary
public SimpleNaturalIdLoadAccessImpl(LoadAccessContext context, EntityMappingType entityDescriptor)

Method Detail

disableFetchProfileback to summary
public SimpleNaturalIdLoadAccess<T> disableFetchProfile(String profileName)

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.disableFetchProfile.

Implements org.hibernate.SimpleNaturalIdLoadAccess.disableFetchProfile.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.disableFetchProfile.

Customize the associations fetched by specifying a fetch profile that should be disabled during this operation.

This allows the session-level fetch profiles to be temporarily overridden.

Annotations
@Override
enableFetchProfileback to summary
public SimpleNaturalIdLoadAccess<T> enableFetchProfile(String profileName)

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.enableFetchProfile.

Implements org.hibernate.SimpleNaturalIdLoadAccess.enableFetchProfile.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.enableFetchProfile.

Customize the associations fetched by specifying a fetch profile that should be enabled during this operation.

This allows the session-level fetch profiles to be temporarily overridden.

Annotations
@Override
getLockOptionsback to summary
public LockOptions getLockOptions()

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.getLockOptions.

Implements org.hibernate.loader.ast.spi.NaturalIdLoadOptions.getLockOptions.

Doc from org.hibernate.loader.ast.spi.NaturalIdLoadOptions.getLockOptions.

The locking options for the loaded entity

Annotations
@Override
getReferenceback to summary
public T getReference(Object naturalIdValue)

Implements org.hibernate.SimpleNaturalIdLoadAccess.getReference.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.getReference.

Return the persistent instance with the given natural id value, assuming that the instance exists. This method might return a proxied instance that is initialized on-demand, when a non-identifier method is accessed.

You should not use this method to determine if an instance exists; to check for existence, use load instead. Use this only to retrieve an instance that you assume exists, where non-existence would be an actual error.

Parameters
naturalIdValue:Object

The value of the natural id

Returns:T

The persistent instance or proxy, if an instance exists. Otherwise, null.

Annotations
@Override
isSynchronizationEnabledback to summary
public boolean isSynchronizationEnabled()

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.isSynchronizationEnabled.

Implements org.hibernate.loader.ast.spi.NaturalIdLoadOptions.isSynchronizationEnabled.

Doc from org.hibernate.loader.ast.spi.NaturalIdLoadOptions.isSynchronizationEnabled.

Whether Hibernate should perform "synchronization" prior to performing look-ups?

Annotations
@Override
loadback to summary
public T load(Object naturalIdValue)

Implements org.hibernate.SimpleNaturalIdLoadAccess.load.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.load.

Return the persistent instance with the given natural id value, or 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.

Parameters
naturalIdValue:Object

The value of the natural-id

Returns:T

The persistent instance or null

Annotations
@Override
loadOptionalback to summary
public Optional<T> loadOptional(Object naturalIdValue)

Implements org.hibernate.SimpleNaturalIdLoadAccess.loadOptional.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.loadOptional.

Just like load, except that here an Optional is returned.

Parameters
naturalIdValue:Object

The identifier

Returns:Optional<T>

The persistent instance, if any, as an Optional

Annotations
@Override
setSynchronizationEnabledback to summary
public SimpleNaturalIdLoadAccessImpl<T> setSynchronizationEnabled(boolean synchronizationEnabled)

Implements org.hibernate.SimpleNaturalIdLoadAccess.setSynchronizationEnabled.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.setSynchronizationEnabled.

For entities with mutable natural ids, should Hibernate perform "synchronization" prior to performing lookups? The default is to perform "synchronization" (for correctness).

See NaturalIdLoadAccess#setSynchronizationEnabled for detailed discussion.

Parameters
synchronizationEnabled:boolean

Should synchronization be performed? true indicates synchronization will be performed; false indicates it will be circumvented.

Returns:SimpleNaturalIdLoadAccessImpl<T>

this, for method chaining

Annotations
@Override
verifySimplicityback to summary
private void verifySimplicity(Object naturalIdValue)
withback to summary
public final SimpleNaturalIdLoadAccessImpl<T> with(LockOptions lockOptions)

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.with.

Implements org.hibernate.SimpleNaturalIdLoadAccess.with.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.with.

Specify the lock options to use when querying the database.

Parameters
lockOptions:LockOptions

The lock options to use

Returns:SimpleNaturalIdLoadAccessImpl<T>

this, for method chaining

Annotations
@Override
withback to summary
public SimpleNaturalIdLoadAccess<T> with(RootGraph<T> graph, GraphSemantic semantic)

Overrides org.hibernate.loader.internal.BaseNaturalIdLoadAccessImpl.with.

Implements org.hibernate.SimpleNaturalIdLoadAccess.with.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.with.

Customize the associations fetched by specifying an entity graph, and how it should be interpreted.

Annotations
@Override
withLoadGraphback to summary
public SimpleNaturalIdLoadAccess<T> withLoadGraph(RootGraph<T> graph)

Overrides default org.hibernate.SimpleNaturalIdLoadAccess.withLoadGraph.

Doc from org.hibernate.SimpleNaturalIdLoadAccess.withLoadGraph.

Augment the associations fetched by default by specifying a list of additional associations to be fetched as an entity graph.

Annotations
@Override