S - Concrete ClientSession typepublic interface MongoResolutionContext<S extends com.mongodb.session.ClientSession> extends MongoContext<S>, com.holonplatform.core.ExpressionResolver.ResolutionContext, com.holonplatform.core.ExpressionResolver.ExpressionResolverSupport
| Modifier and Type | Method and Description |
|---|---|
MongoResolutionContext<S> |
childContext()
Create a new
MongoResolutionContext as child of this context. |
MongoResolutionContext<S> |
childContextForUpdate()
Create a new
MongoResolutionContext as child of this context for update type operations. |
MongoResolutionContext<S> |
childContextForUpdate(com.holonplatform.core.Path<?> updatePath)
Create a new
MongoResolutionContext as child of this context for update type operations. |
static <S extends com.mongodb.session.ClientSession> |
create(MongoContext<S> context)
Create a new default
MongoResolutionContext. |
static <S extends com.mongodb.session.ClientSession> |
createForUpdate(MongoContext<S> context)
Create a new default
MongoResolutionContext for an update type operation. |
static <S extends com.mongodb.session.ClientSession> |
createForUpdate(MongoContext<S> context,
com.holonplatform.core.Path<?> updatePath)
Create a new default
MongoResolutionContext for an update type operation, specifying the Path to
which the update operation refers. |
default MongoDocumentContext<S> |
documentContext(com.holonplatform.core.property.PropertySet<?> propertySet)
Create a
MongoDocumentContext as child of this context. |
MongoDocumentContext<S> |
documentContext(com.holonplatform.core.property.PropertySet<?> propertySet,
boolean resolveDocumentId)
Create a
MongoDocumentContext as child of this context. |
default Optional<String> |
getAlias(com.holonplatform.core.TypedExpression<?> expression)
Get the alias associated to given expression, if any.
|
default <E> Optional<com.holonplatform.core.TypedExpression<E>> |
getExpression(String alias)
Get the expression bound to given alias, if any.
|
com.holonplatform.datastore.mongo.core.internal.context.ExpressionAliasProvider |
getExpressionAliasProvider()
Get the
ExpressionAliasProvider. |
default String |
getNextProjectionFieldName()
For generated projection field names, get the next name.
|
default String |
getOrCreateAlias(com.holonplatform.core.TypedExpression<?> expression)
Get the alias for given expression or create one if does not exist.
|
Optional<MongoResolutionContext<S>> |
getParent()
Get the parent context, if available.
|
Optional<QueryOperationType> |
getQueryOperationType()
Get the
QueryOperationType. |
Optional<com.holonplatform.core.Path<?>> |
getUpdatePath()
If this context is intended for an update type operation, get the optional single
Path to which the
update operation refers. |
boolean |
isForUpdate()
Get whether this context is intended for an update type operation.
|
static Optional<MongoResolutionContext<?>> |
isMongoResolutionContext(com.holonplatform.core.ExpressionResolver.ResolutionContext context)
Checks if given
ExpressionResolver.ResolutionContext is a MongoResolutionContext. |
default boolean |
maybeAliasName(String fieldName)
Check if given field name could be an alias name.
|
default <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> |
resolve(E expression,
Class<R> resolutionType)
Try to resolve given
expression using current context resolvers to obtain a
resolutionType type expression. |
default <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> |
resolveOrFail(E expression,
Class<R> resolutionType)
Resolve given
expression using current context resolvers to obtain a resolutionType
type expression. |
void |
setQueryOperationType(QueryOperationType queryOperationType)
Set the
QueryOperationType. |
getClientSession, getDatabaseCodecRegistry, getDefaultEnumCodecStrategy, getDefaultReadConcern, getDefaultReadPreference, getDefaultWriteConcern, getDocumentIdResolver, toJson, toJson, toJson, trace, trace, trace, traceresolveOptional<MongoResolutionContext<S>> getParent()
boolean isForUpdate()
true if this context is intended for an update type operation, false otherwiseOptional<com.holonplatform.core.Path<?>> getUpdatePath()
Path to which the
update operation refers.Path to which the update operation refersisForUpdate()Optional<QueryOperationType> getQueryOperationType()
QueryOperationType.void setQueryOperationType(QueryOperationType queryOperationType)
QueryOperationType.queryOperationType - The query operation type to setcom.holonplatform.datastore.mongo.core.internal.context.ExpressionAliasProvider getExpressionAliasProvider()
ExpressionAliasProvider.default Optional<String> getAlias(com.holonplatform.core.TypedExpression<?> expression)
expression - The expression to get the alias for (not null)default String getOrCreateAlias(com.holonplatform.core.TypedExpression<?> expression)
expression - The expression to get the alias for (not null)default <E> Optional<com.holonplatform.core.TypedExpression<E>> getExpression(String alias)
E - Expression typealias - Expression aliasdefault String getNextProjectionFieldName()
default boolean maybeAliasName(String fieldName)
fieldName - Field nametrue if if given field name could be an alias name, false otherwisedefault <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> Optional<R> resolve(E expression, Class<R> resolutionType) throws com.holonplatform.core.Expression.InvalidExpressionException
expression using current context resolvers to obtain a
resolutionType type expression.
The resolved expression is validate using Expression.validate() before returning it to caller.
E - Expression typeR - Resolution typeexpression - Expression to resolveresolutionType - Expression type to obtaincom.holonplatform.core.Expression.InvalidExpressionExceptiondefault <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> R resolveOrFail(E expression,
Class<R> resolutionType)
expression using current context resolvers to obtain a resolutionType
type expression. If no ExpressionResolver is available to resolve given expression, an
Expression.InvalidExpressionException is thrown.
The resolved expression is validate using Expression.validate() before returning it to caller.
E - Expression typeR - Resolution typeexpression - Expression to resolveresolutionType - Expression type to obtaincom.holonplatform.core.Expression.InvalidExpressionException - If an error occurred during resolution, or if no ExpressionResolver is
available to resolve given expression or if expression validation failedMongoResolutionContext<S> childContext()
MongoResolutionContext as child of this context. This context will be setted as parent of
the new context.MongoResolutionContext with this context as parentMongoResolutionContext<S> childContextForUpdate()
MongoResolutionContext as child of this context for update type operations. This context
will be setted as parent of the new context.MongoResolutionContext with this context as parentMongoResolutionContext<S> childContextForUpdate(com.holonplatform.core.Path<?> updatePath)
MongoResolutionContext as child of this context for update type operations. This context
will be setted as parent of the new context.updatePath - The path to which the update operation refersMongoResolutionContext with this context as parentdefault MongoDocumentContext<S> documentContext(com.holonplatform.core.property.PropertySet<?> propertySet)
MongoDocumentContext as child of this context.propertySet - The PropertySet to which the document is bound (not null)MongoDocumentContext instanceMongoDocumentContext<S> documentContext(com.holonplatform.core.property.PropertySet<?> propertySet, boolean resolveDocumentId)
MongoDocumentContext as child of this context.propertySet - The PropertySet to which the document is bound (not null)resolveDocumentId - Whether to resolve the document id propertyMongoDocumentContext instancestatic <S extends com.mongodb.session.ClientSession> MongoResolutionContext<S> create(MongoContext<S> context)
MongoResolutionContext.S - Concrete client session typecontext - MongoContext to use (not null)MongoResolutionContextstatic <S extends com.mongodb.session.ClientSession> MongoResolutionContext<S> createForUpdate(MongoContext<S> context)
MongoResolutionContext for an update type operation.S - Concrete client session typecontext - MongoContext to use (not null)MongoResolutionContextstatic <S extends com.mongodb.session.ClientSession> MongoResolutionContext<S> createForUpdate(MongoContext<S> context, com.holonplatform.core.Path<?> updatePath)
MongoResolutionContext for an update type operation, specifying the Path to
which the update operation refers.S - Concrete client session typecontext - MongoContext to use (not null)updatePath - Update operation PathMongoResolutionContextstatic Optional<MongoResolutionContext<?>> isMongoResolutionContext(com.holonplatform.core.ExpressionResolver.ResolutionContext context)
ExpressionResolver.ResolutionContext is a MongoResolutionContext.context - The context to checkMongoResolutionContext, it is returned as a MongoResolutionContext
type. Otherwise, an empty Optional is returned.Copyright © 2019 The Holon Platform. All rights reserved.