public class TemplatedExecutableStatementBuilder extends AbstractExecutableStatementBuilder
ExecutableSearchBuilder that generates the SQL statement to
be executed by evaluating a Template against the currently resolved attributes within a
AttributeResolutionContext.| Modifier and Type | Class and Description |
|---|---|
protected static class |
TemplatedExecutableStatementBuilder.EscapingReferenceInsertionEventHandler
Escapes SQL values added to the template context.
|
| Modifier and Type | Field and Description |
|---|---|
private VelocityEngine |
engine
VelocityEngine.
|
private ReferenceInsertionEventHandler |
eventHandler
Event handler used for escaping.
|
private org.slf4j.Logger |
log
Class logger.
|
private Template |
template
Template to be evaluated.
|
private String |
templateText
Template (as Text) to be evaluated.
|
private boolean |
v2Compatibility
Do we need to make ourself V2 Compatible?
|
| Constructor and Description |
|---|
TemplatedExecutableStatementBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInitialize() |
ReferenceInsertionEventHandler |
getReferenceInsertionEventHandler()
Gets the
ReferenceInsertionEventHandler to be used. |
protected String |
getSQLQuery(AttributeResolutionContext resolutionContext,
Map<String,List<IdPAttributeValue<?>>> dependencyAttributes)
Apply the context to the template.
|
Template |
getTemplate()
Gets the template to be evaluated.
|
String |
getTemplateText()
Gets the template text to be evaluated.
|
VelocityEngine |
getVelocityEngine()
Gets the
VelocityEngine to be used. |
boolean |
isV2Compatibility()
Are we in V2 Compatibility mode?
|
protected String |
merge(VelocityContext context)
Invokes
Template.merge(org.apache.velocity.context.Context) on the supplied context. |
void |
setReferenceInsertionEventHandler(ReferenceInsertionEventHandler handler)
Sets the
ReferenceInsertionEventHandler to be used. |
void |
setTemplateText(String velocityTemplate)
Sets the template to be evaluated.
|
void |
setV2Compatibility(boolean compat)
What is out V2 Compatibility mode.
|
void |
setVelocityEngine(VelocityEngine velocityEngine)
Sets the
VelocityEngine to be used. |
build, getQueryTimeout, setQueryTimeoutdestroy, doDestroy, initialize, isDestroyed, isInitializedprivate final org.slf4j.Logger log
private Template template
private String templateText
private VelocityEngine engine
private ReferenceInsertionEventHandler eventHandler
private boolean v2Compatibility
@NonnullAfterInit public Template getTemplate()
@NonnullAfterInit public String getTemplateText()
public void setTemplateText(@Nullable String velocityTemplate)
velocityTemplate - template to be evaluated@Nullable @NonnullAfterInit public VelocityEngine getVelocityEngine()
VelocityEngine to be used.public void setVelocityEngine(@Nonnull VelocityEngine velocityEngine)
VelocityEngine to be used.velocityEngine - engine to be used@Nullable public ReferenceInsertionEventHandler getReferenceInsertionEventHandler()
ReferenceInsertionEventHandler to be used.public void setReferenceInsertionEventHandler(@Nullable ReferenceInsertionEventHandler handler)
ReferenceInsertionEventHandler to be used.handler - reference insertion event handler to be usedpublic boolean isV2Compatibility()
public void setV2Compatibility(boolean compat)
compat - The mode to set.protected String merge(@Nonnull VelocityContext context)
Template.merge(org.apache.velocity.context.Context) on the supplied context.context - to mergeprotected String getSQLQuery(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue<?>>> dependencyAttributes) throws ResolutionException
getSQLQuery in class AbstractExecutableStatementBuilderresolutionContext - the context of the resolutiondependencyAttributes - made available to the executable searchResolutionException - if we get an error building the exception.protected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.