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> @Nullable 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> @NonNull 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) @NonNull StatementReferenceregisterNamedMutation(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
Returns all selection-query references keyed by registration name.- See Also:
-
forEachNamedQuery
Perform an action for all registered selection-query references. -
registerNamedQuery
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
Map<String, StatementReference> getNamedMutations()Returns all mutation-query references keyed by registration name.- See Also:
-
forEachNamedMutation
Perform an action for all registered mutation-query references. -
registerNamedMutation
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
<R> @Nullable NamedQueryMemento<R> findQueryMementoByName(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
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
-
checkNamedQueries
Perform a validity check on all named queries -
validateNamedQueries
Validate the named queries and throw an exception if any are broken -
resolve
NamedQueryMemento<?> resolve(SessionFactoryImplementor sessionFactory, MetadataImplementor bootMetamodel, String registrationName) Resolve the named query with the given name. -
prepare
Prepare for runtime use -
close
void close()Release any held resources
-