Interface NamedObjectRepository
Repository for references to named things related to queries. This includes:
- named HQL, JPQL, native, and procedure queries,
- along with named result set mappings.
-
Method Summary
Modifier and TypeMethodDescriptioncheckNamedQueries(QueryEngine queryPlanCache) Perform a validity check on all named queriesvoidclose()Release any held resources<R> NamedQueryMemento<R> findQueryMementoByName(String name, boolean includeProcedureCalls) Find a query registration by name, regardless of query type.voidforEachNamedMutation(BiConsumer<String, ? super StatementReference> action) Perform an action for all registered mutation-query references.voidforEachNamedQuery(BiConsumer<String, ? super TypedQueryReference<?>> action) Perform an action for all registered selection-query references.<R> NamedMutationMemento<R> Returns all mutation-query references keyed by registration name.<R> Map<String, TypedQueryReference<R>> getNamedQueries(Class<R> resultType) Returns all selection-query references keyed by registration name.<R> NamedQueryMemento<R> getQueryMementoByName(String name, boolean includeProcedureCalls) Find a query registration by name, regardless of query type, throwing an exception if one could not be found.getResultSetMappingMemento(String mappingName) <R> NamedSelectionMemento<R> voidprepare(SessionFactoryImplementor sessionFactory, Metadata bootMetamodel) Prepare for runtime usevoidregisterCallableQueryMemento(String name, NamedCallableQueryMemento memento) registerNamedMutation(String name, Statement statement) Registers the given mutation-query using the given name, returning a registration reference, which can be used later to create a query instance.<R> TypedQueryReference<R> registerNamedQuery(String name, TypedQuery<R> query) Registers the given selection-query using the given name, returning a registration reference, which can be used later to create a query instance.voidregisterResultSetMappingMemento(String name, NamedResultSetMappingMemento memento) resolve(SessionFactoryImplementor sessionFactory, MetadataImplementor bootMetamodel, String registrationName) Resolve the named query with the given name.voidvalidateNamedQueries(QueryEngine queryEngine) Validate the named queries and throw an exception if any are brokenvoidvoid
-
Method Details
-
getNamedQueries
-
forEachNamedQuery
Perform an action for all registered selection-query references. -
registerNamedQuery
@Nonnull <R> TypedQueryReference<R> registerNamedQuery(@Nonnull String name, @Nonnull TypedQuery<R> query) Registers the given selection-query using the given name, returning a registration reference, which can be used later to create a query instance.- See Also:
-
getNamedMutations
Returns all mutation-query references keyed by registration name.- See Also:
-
forEachNamedMutation
Perform an action for all registered mutation-query references. -
registerNamedMutation
@Nonnull StatementReference registerNamedMutation(@Nonnull String name, @Nonnull Statement statement) Registers the given mutation-query using the given name, returning a registration reference, which can be used later to create a query instance.- See Also:
-
findQueryMementoByName
@Nullable <R> NamedQueryMemento<R> findQueryMementoByName(@Nonnull String name, boolean includeProcedureCalls) Find a query registration by name, regardless of query type.- Returns:
- The query registration, or
nullif one could not be found
-
getQueryMementoByName
@Nonnull <R> NamedQueryMemento<R> getQueryMementoByName(@Nonnull String name, boolean includeProcedureCalls) Find a query registration by name, regardless of query type, throwing an exception if one could not be found.- Returns:
- The query registration.
- Throws:
UnknownNamedQueryException- If one could not be found under that name.
-
getSelectionQueryMemento
-
getMutationQueryMemento
-
getCallableQueryMemento
-
visitCallableQueryMementos
-
registerCallableQueryMemento
-
getResultSetMappingMemento
-
visitResultSetMappingMementos
-
registerResultSetMappingMemento
void registerResultSetMappingMemento(@Nonnull String name, @Nonnull NamedResultSetMappingMemento memento) -
checkNamedQueries
Perform a validity check on all named queries -
validateNamedQueries
Validate the named queries and throw an exception if any are broken -
resolve
@Nullable NamedQueryMemento<?> resolve(@Nonnull SessionFactoryImplementor sessionFactory, @Nonnull MetadataImplementor bootMetamodel, @Nonnull String registrationName) Resolve the named query with the given name. -
prepare
Prepare for runtime use -
close
void close()Release any held resources
-