Class LoaderHelper
- java.lang.Object
-
- org.hibernate.loader.ast.internal.LoaderHelper
-
public class LoaderHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description LoaderHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <X> X[]createTypedArray(Class<X> elementClass, int length)Creates a typed array, as opposed to a genericObject[]that holds the typed valuesstatic BooleangetReadOnlyFromLoadQueryInfluencers(LoadQueryInfluencers loadQueryInfluencers)Determine if given influencers indicate read-onlystatic BooleangetReadOnlyFromLoadQueryInfluencers(SharedSessionContractImplementor session)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 voidupgradeLock(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.
-
-
-
Method Detail
-
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.
-
getReadOnlyFromLoadQueryInfluencers
public static Boolean getReadOnlyFromLoadQueryInfluencers(SharedSessionContractImplementor session)
Determine if the influencers associated with the given Session indicate read-only
-
getReadOnlyFromLoadQueryInfluencers
public static Boolean getReadOnlyFromLoadQueryInfluencers(LoadQueryInfluencers loadQueryInfluencers)
Determine if given influencers indicate read-only
-
normalizeKeys
public static <K> K[] normalizeKeys(K[] keys, BasicValuedModelPart keyPart, SharedSessionContractImplementor session, SessionFactoryImplementor sessionFactory)Normalize an array of keys (primary, foreign or natural). If the array is already typed as the key type,keysis simply returned. Otherwise, a new typed array is created and the contents copied fromkeysto this new array. If key coercion is enabled, the values will be coerced to the key type.- Type Parameters:
K- The key type- Parameters:
keys- The keys to normalizekeyPart- The ModelPart describing the key
-
createTypedArray
public static <X> X[] createTypedArray(Class<X> elementClass, int length)
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
-
loadByArrayParameter
public static <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).- Type Parameters:
R- The type of the model part to loadK- The type of the keys
-
-