public class DefaultSQLCompositionContext extends Object implements SQLCompositionContext
SQLCompositionContext implementation.SQLCompositionContext.SQLStatementPreparationException| Constructor and Description |
|---|
DefaultSQLCompositionContext(SQLCompositionContext parent)
Constructor with parent composition context.
|
DefaultSQLCompositionContext(SQLContext context)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> |
addExpressionResolver(com.holonplatform.core.ExpressionResolver<E,R> expressionResolver) |
SQLCompositionContext |
childContext()
Create a new
SQLCompositionContext as child of this context. |
SQLDialect |
getDialect()
Get the
SQLDialect to use. |
Iterable<com.holonplatform.core.ExpressionResolver> |
getExpressionResolvers() |
SQLContextParametersHandler |
getNamedParametersHandler()
Get the SQL named parameters handler.
|
Optional<SQLCompositionContext> |
getParent()
Get the parent context, if available.
|
SQLValueDeserializer |
getValueDeserializer()
Get the
SQLValueDeserializer of this context. |
SQLValueSerializer |
getValueSerializer()
Get the
SQLValueSerializer of this context. |
SQLStatement |
prepareStatement(String sql)
Prepare given SQL statement, replacing named parameters with the default
? parameter placeholder. |
<E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> |
removeExpressionResolver(com.holonplatform.core.ExpressionResolver<E,R> expressionResolver) |
<E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> |
resolve(E expression,
Class<R> resolutionType,
com.holonplatform.core.ExpressionResolver.ResolutionContext context) |
void |
trace(String sql)
Trace given SQL statement.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNamedParameter, create, getContextSequence, isSQLCompositionContext, isStatementCompositionContext, resolve, resolveOrFailgetTypeConverterpublic DefaultSQLCompositionContext(SQLContext context)
context - SQL context (not null)public DefaultSQLCompositionContext(SQLCompositionContext parent)
parent - Parent context (not null)public Optional<SQLCompositionContext> getParent()
SQLCompositionContextgetParent in interface SQLCompositionContextpublic SQLDialect getDialect()
SQLContextSQLDialect to use.getDialect in interface SQLContextpublic SQLValueSerializer getValueSerializer()
SQLContextSQLValueSerializer of this context.getValueSerializer in interface SQLContextSQLValueSerializerpublic SQLValueDeserializer getValueDeserializer()
SQLContextSQLValueDeserializer of this context.getValueDeserializer in interface SQLContextSQLValueDeserializerpublic void trace(String sql)
SQLContext
If tracing is enabled, the SQL statement is logged using the INFO level, otherwise it is logged
using the DEBUG level.
trace in interface SQLContextsql - SQL to tracepublic SQLContextParametersHandler getNamedParametersHandler()
SQLCompositionContextgetNamedParametersHandler in interface SQLCompositionContextpublic SQLStatement prepareStatement(String sql)
SQLCompositionContext? parameter placeholder.prepareStatement in interface SQLCompositionContextsql - The SQL statement to prepare (not null)SQLStatement which provides the prepared SQL and the statement parameter definition in the
right order according to the parameters placeholder indexpublic SQLCompositionContext childContext()
SQLCompositionContextSQLCompositionContext as child of this context. This context will be setted as parent of the
new context.childContext in interface SQLCompositionContextSQLCompositionContext with this context as parentpublic Iterable<com.holonplatform.core.ExpressionResolver> getExpressionResolvers()
getExpressionResolvers in interface com.holonplatform.core.ExpressionResolver.ExpressionResolverProviderpublic <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> Optional<R> resolve(E expression, Class<R> resolutionType, com.holonplatform.core.ExpressionResolver.ResolutionContext context) throws com.holonplatform.core.Expression.InvalidExpressionException
resolve in interface com.holonplatform.core.ExpressionResolver.ExpressionResolverHandlercom.holonplatform.core.Expression.InvalidExpressionExceptionpublic <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> void addExpressionResolver(com.holonplatform.core.ExpressionResolver<E,R> expressionResolver)
addExpressionResolver in interface com.holonplatform.core.ExpressionResolver.ExpressionResolverSupportpublic <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> void removeExpressionResolver(com.holonplatform.core.ExpressionResolver<E,R> expressionResolver)
removeExpressionResolver in interface com.holonplatform.core.ExpressionResolver.ExpressionResolverSupportCopyright © 2019 The Holon Platform. All rights reserved.