S
- Concrete ClientSession typepublic interface MongoDocumentContext<S extends com.mongodb.session.ClientSession> extends MongoResolutionContext<S>
MongoResolutionContext
which is bound to a document resolution operation.Modifier and Type | Field and Description |
---|---|
static String |
ID_FIELD_NAME
Default MongoDB document id field name
|
Modifier and Type | Method and Description |
---|---|
static <S extends com.mongodb.session.ClientSession> |
create(MongoContext<S> context,
com.holonplatform.core.property.PropertySet<?> propertySet)
Create a new
MongoDocumentContext . |
static <S extends com.mongodb.session.ClientSession> |
createForUpdate(MongoContext<S> context,
com.holonplatform.core.property.PropertySet<?> propertySet)
Create a new
MongoDocumentContext for an update type operation. |
Optional<com.holonplatform.core.Path<?>> |
getDocumentIdPath()
Get the
Path which acts as document id, if available. |
Optional<com.holonplatform.core.property.Property<?>> |
getDocumentIdProperty()
Get the
Property which acts as document id, if available. |
<P extends com.holonplatform.core.property.Property<?>> |
getPropertySet()
Get the
PropertySet to which the document resolution is bound. |
static Optional<MongoDocumentContext<?>> |
isDocumentContext(com.holonplatform.core.ExpressionResolver.ResolutionContext context)
Checks if given resolution context is a
MongoDocumentContext type. |
Optional<com.holonplatform.core.Path<?>> |
isDocumentIdPath(com.holonplatform.core.Path<?> path)
Checks if given path matches the document id path, if available.
|
default boolean |
isDocumentIdProperty(com.holonplatform.core.property.Property<?> property)
Checks if given property is the document id property.
|
childContext, childContextForUpdate, childContextForUpdate, create, createForUpdate, createForUpdate, documentContext, documentContext, getAlias, getExpression, getExpressionAliasProvider, getNextProjectionFieldName, getOrCreateAlias, getParent, getQueryOperationType, getUpdatePath, isForUpdate, isMongoResolutionContext, maybeAliasName, resolve, resolveOrFail, setQueryOperationType
getClientSession, getDatabaseCodecRegistry, getDefaultEnumCodecStrategy, getDefaultReadConcern, getDefaultReadPreference, getDefaultWriteConcern, getDocumentIdResolver, toJson, toJson, toJson, trace, trace, trace, trace
resolve
static final String ID_FIELD_NAME
<P extends com.holonplatform.core.property.Property<?>> com.holonplatform.core.property.PropertySet<P> getPropertySet()
PropertySet
to which the document resolution is bound.P
- Property typePropertySet
Optional<com.holonplatform.core.Path<?>> getDocumentIdPath()
Path
which acts as document id, if available.Optional<com.holonplatform.core.property.Property<?>> getDocumentIdProperty()
Property
which acts as document id, if available.default boolean isDocumentIdProperty(com.holonplatform.core.property.Property<?> property)
property
- The property to checktrue
if the property acts as document id propertyOptional<com.holonplatform.core.Path<?>> isDocumentIdPath(com.holonplatform.core.Path<?> path)
path
- The path to checkstatic Optional<MongoDocumentContext<?>> isDocumentContext(com.holonplatform.core.ExpressionResolver.ResolutionContext context)
MongoDocumentContext
type.context
- The context to checkMongoDocumentContext
, returns the context itself as a
MongoDocumentContext
type. Otherwise an empty Optional is returned.static <S extends com.mongodb.session.ClientSession> MongoDocumentContext<S> create(MongoContext<S> context, com.holonplatform.core.property.PropertySet<?> propertySet)
MongoDocumentContext
.S
- Concrete client session typecontext
- Mongo context (not null)propertySet
- The PropertySet
to which the document is bound (not null)MongoDocumentContext
instancestatic <S extends com.mongodb.session.ClientSession> MongoDocumentContext<S> createForUpdate(MongoContext<S> context, com.holonplatform.core.property.PropertySet<?> propertySet)
MongoDocumentContext
for an update type operation.S
- Concrete client session typecontext
- Mongo context (not null)propertySet
- The PropertySet
to which the document is bound (not null)MongoDocumentContext
instanceCopyright © 2019 The Holon Platform. All rights reserved.