Class LoaderHelper
java.lang.Object
org.hibernate.loader.ast.internal.LoaderHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <X> X[]
createTypedArray
(Class<X> elementClass, int length) Creates a typed array, as opposed to a genericObject[]
that holds the typed valuesstatic Boolean
getReadOnlyFromLoadQueryInfluencers
(LoadQueryInfluencers loadQueryInfluencers) Determine if given influencers indicate read-onlystatic Boolean
Determine if the influencers associated with the given Session indicate read-onlystatic <R,
K> List<R> loadByArrayParameter
(K[] idsToInitialize, SelectStatement sqlAst, JdbcOperationQuerySelect jdbcOperation, JdbcParameter jdbcParameter, JdbcMapping arrayJdbcMapping, Object entityId, Object entityInstance, EntityMappingType rootEntityDescriptor, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session) Load one or more instances of a model part (an entity or collection) based on a SQL ARRAY parameter to specify the keys (as opposed to the more traditional SQL IN predicate approach).static <K> K[]
normalizeKeys
(K[] keys, BasicValuedModelPart keyPart, SharedSessionContractImplementor session, SessionFactoryImplementor sessionFactory) Normalize an array of keys (primary, foreign or natural).static void
upgradeLock
(Object object, EntityEntry entry, LockOptions lockOptions, EventSource session) Ensure the LockMode associated with the entity in relation to a persistence context is great or equal to the requested mode, performing a pessimistic lock upgrade on a given entity, if needed.
-
Constructor Details
-
LoaderHelper
public LoaderHelper()
-
-
Method Details
-
upgradeLock
public static void upgradeLock(Object object, EntityEntry entry, LockOptions lockOptions, EventSource session) Ensure the LockMode associated with the entity in relation to a persistence context is great or equal to the requested mode, performing a pessimistic lock upgrade on a given entity, if needed.- Parameters:
object
- The entity for which to upgrade the lock.entry
- The entity'sEntityEntry
instance.lockOptions
- Contains the requested lock mode.session
- The session which is the source of the event being processed.
-
getReadOnlyFromLoadQueryInfluencers
public static Boolean getReadOnlyFromLoadQueryInfluencers(LoadQueryInfluencers loadQueryInfluencers) Determine if given influencers indicate read-only -
createTypedArray
Creates a typed array, as opposed to a genericObject[]
that holds the typed values- Parameters:
elementClass
- The type of the array elements. SeeClass.getComponentType()
length
- The length to which the array should be created. This is usually zero for Hibernate uses
-