Class AbstractHibernateOperations<S,Q,P extends Q>  
java.lang.Object
io.micronaut.data.hibernate.operations.AbstractHibernateOperations<S,Q,P>  
- Type Parameters:
- S- The session type
- Q- The query type
- P- The selection query
- All Implemented Interfaces:
- HintsCapableRepository,- PreparedQueryDecorator,- StoredQueryDecorator
@Internal
public abstract class AbstractHibernateOperations<S,Q,P extends Q>  
extends Object
implements HintsCapableRepository, PreparedQueryDecorator, StoredQueryDecorator
Abstract Hibernate operations shared between the synchronous and the reactive implementations.
- Since:
- 3.5.0
- Author:
- Denis Stepaov
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classThe result collector.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final io.micronaut.core.convert.ConversionServiceprotected final RuntimeEntityRegistry
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractHibernateOperations(RuntimeEntityRegistry runtimeEntityRegistry, DataConversionService dataConversionService) Default constructor.
- 
Method SummaryModifier and TypeMethodDescriptionprotected <T,R> void bindParameters(Q q, @NonNull PreparedQuery<T, R> preparedQuery) Bind parameters into query.protected final <R> voidcollectCountOf(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, S session, Class<R> entity, @Nullable Pageable pageable, AbstractHibernateOperations<S, Q, P>.ResultCollector<Long> resultCollector) protected <R> voidcollectFindAll(S session, PreparedQuery<?, R> preparedQuery, AbstractHibernateOperations<S, Q, P>.ResultCollector<R> collector) Collect all results.protected <R> voidcollectFindOne(S session, PreparedQuery<?, R> preparedQuery, AbstractHibernateOperations<S, Q, P>.ResultCollector<R> collector) Collect one result.protected final <T> voidcollectPagedResults(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, S session, PagedQuery<T> pagedQuery, AbstractHibernateOperations<S, Q, P>.ResultCollector<T> resultCollector) protected abstract <T> jakarta.persistence.EntityGraph<T>createEntityGraph(S session, Class<T> entityType) Creates an entity graph.protected abstract PcreateNativeQuery(S session, String query, Class<?> resultType) Create a new native query.protected abstract PcreateQuery(S session, jakarta.persistence.criteria.CriteriaQuery<?> criteriaQuery) Create a native query.protected abstract PcreateQuery(S session, String query, @Nullable Class<?> resultType) Create a new query.<E,R> PreparedQuery<E, R> decorate(PreparedQuery<E, R> preparedQuery) Decorate prepared query.<E,R> StoredQuery<E, R> decorate(StoredQuery<E, R> storedQuery) Decorate stored query.protected io.micronaut.context.ApplicationContextprotected io.micronaut.core.convert.ConversionServiceprotected abstract <T> @NonNull RuntimePersistentEntity<T>Gets the persistence entity.protected abstract <T> jakarta.persistence.EntityGraph<T>getEntityGraph(S session, Class<T> entityType, String graphName) Gets an entity graph.protected final jakarta.persistence.FlushModeTypegetFlushModeType(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) protected final ObjectgetParameterValue(String[] propertyPath, Object value) getQueryHints(@NonNull StoredQuery<?, ?> storedQuery) Obtain any custom query hints for this method and repository implementation.protected abstract voidSets a hint.protected abstract voidsetMaxResults(P query, int max) Sets the max results value.protected abstract voidSets the offset value.protected abstract voidsetParameter(Q query, String parameterName, Object value) Sets a parameter into query.protected abstract voidsetParameter(Q query, String parameterName, Object value, io.micronaut.core.type.Argument<?> argument) Sets parameter into query.protected abstract voidsetParameterList(Q query, String parameterName, Collection<Object> value) Sets a list parameter into query.protected abstract voidsetParameterList(Q query, String parameterName, Collection<Object> value, io.micronaut.core.type.Argument<?> argument) Sets a list parameter into query.
- 
Field Details- 
dataConversionServiceprotected final io.micronaut.core.convert.ConversionService dataConversionService
- 
runtimeEntityRegistry
 
- 
- 
Constructor Details- 
AbstractHibernateOperationsprotected AbstractHibernateOperations(RuntimeEntityRegistry runtimeEntityRegistry, DataConversionService dataConversionService) Default constructor.- Parameters:
- runtimeEntityRegistry- The runtime entity registry
- dataConversionService- The data conversion service
 
 
- 
- 
Method Details- 
decorateDescription copied from interface:PreparedQueryDecoratorDecorate prepared query.- Specified by:
- decoratein interface- PreparedQueryDecorator
- Type Parameters:
- E- The entity type
- R- The result type
- Parameters:
- preparedQuery- The query to be decorated
- Returns:
- decorated prepared query
 
- 
decorateDescription copied from interface:StoredQueryDecoratorDecorate stored query.- Specified by:
- decoratein interface- StoredQueryDecorator
- Type Parameters:
- E- The entity type
- R- The result type
- Parameters:
- storedQuery- The query to be decorated
- Returns:
- decorated stored query
 
- 
getApplicationContextprotected io.micronaut.context.ApplicationContext getApplicationContext()- Returns:
- The application context
 
- 
getConversionServiceprotected io.micronaut.core.convert.ConversionService getConversionService()- Returns:
- The conversion service
 
- 
getEntity@NonNull protected abstract <T> @NonNull RuntimePersistentEntity<T> getEntity(@NonNull @NonNull Class<T> type) Gets the persistence entity.- Type Parameters:
- T- The entity type
- Parameters:
- type- The entity type
- Returns:
- The persistent entity
 
- 
getQueryHints@NonNull public @NonNull Map<String,Object> getQueryHints(@NonNull @NonNull StoredQuery<?, ?> storedQuery) Description copied from interface:HintsCapableRepositoryObtain any custom query hints for this method and repository implementation.- Specified by:
- getQueryHintsin interface- HintsCapableRepository
- Parameters:
- storedQuery- The stored query
- Returns:
- THe query hints
 
- 
setParameterSets a parameter into query.- Parameters:
- query- The query
- parameterName- The parameter name
- value- The value
 
- 
setParameterprotected abstract void setParameter(Q query, String parameterName, Object value, io.micronaut.core.type.Argument<?> argument) Sets parameter into query.- Parameters:
- query- The query
- parameterName- The parameter name
- value- The value
- argument- The argument
 
- 
setParameterListSets a list parameter into query.- Parameters:
- query- The query
- parameterName- The parameter name
- value- The value
 
- 
setParameterListprotected abstract void setParameterList(Q query, String parameterName, Collection<Object> value, io.micronaut.core.type.Argument<?> argument) Sets a list parameter into query.- Parameters:
- query- The query
- parameterName- The parameter name
- value- The value
- argument- The argument
 
- 
setHintSets a hint.- Parameters:
- query- The query
- hintName- The hint name
- value- The value
 
- 
setMaxResultsSets the max results value.- Parameters:
- query- The query
- max- The max value
 
- 
setOffsetSets the offset value.- Parameters:
- query- The query
- offset- The offset value
 
- 
getEntityGraphprotected abstract <T> jakarta.persistence.EntityGraph<T> getEntityGraph(S session, Class<T> entityType, String graphName) Gets an entity graph.- Type Parameters:
- T- The entity type
- Parameters:
- session- The session
- entityType- The entity type
- graphName- The graph name
- Returns:
- The graph
 
- 
createEntityGraphprotected abstract <T> jakarta.persistence.EntityGraph<T> createEntityGraph(S session, Class<T> entityType) Creates an entity graph.- Type Parameters:
- T- The entityType
- Parameters:
- session- The session
- entityType- The entityType
- Returns:
- The graph
 
- 
createQueryCreate a new query.- Parameters:
- session- The session
- query- The query
- resultType- The result type
- Returns:
- new query
 
- 
createNativeQueryCreate a new native query.- Parameters:
- session- The session
- query- The query
- resultType- The result type
- Returns:
- new query
 
- 
createQueryprotected abstract P createQuery(S session, jakarta.persistence.criteria.CriteriaQuery<?> criteriaQuery) Create a native query.- Parameters:
- session- The session
- criteriaQuery- The criteriaQuery
- Returns:
- new query
 
- 
collectFindOneprotected <R> void collectFindOne(S session, PreparedQuery<?, R> preparedQuery, AbstractHibernateOperations<S, Q, P>.ResultCollector<R> collector) Collect one result.- Type Parameters:
- R- The result type
- Parameters:
- session- The session
- preparedQuery- The prepared query
- collector- The collector
 
- 
collectFindAllprotected <R> void collectFindAll(S session, PreparedQuery<?, R> preparedQuery, AbstractHibernateOperations<S, Q, P>.ResultCollector<R> collector) Collect all results.- Type Parameters:
- R- The result type
- Parameters:
- session- The session
- preparedQuery- The prepared query
- collector- The collector
 
- 
bindParametersBind parameters into query.- Type Parameters:
- T- The entity type
- R- The result type
- Parameters:
- q- The query
- preparedQuery- THe prepared query
 
- 
getParameterValue
- 
getFlushModeTypeprotected final jakarta.persistence.FlushModeType getFlushModeType(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) 
- 
collectPagedResultsprotected final <T> void collectPagedResults(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, S session, PagedQuery<T> pagedQuery, AbstractHibernateOperations<S, Q, P>.ResultCollector<T> resultCollector) 
- 
collectCountOfprotected final <R> void collectCountOf(jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder, S session, Class<R> entity, @Nullable @Nullable Pageable pageable, AbstractHibernateOperations<S, Q, P>.ResultCollector<Long> resultCollector) 
 
-