Package org.mybatis.scripting.freemarker
Class FreeMarkerSqlSource
java.lang.Object
org.mybatis.scripting.freemarker.FreeMarkerSqlSource
- All Implemented Interfaces:
org.apache.ibatis.mapping.SqlSource
Applies provided parameter(s) to FreeMarker template. Then passes the result into default MyBatis engine (and it
finally replaces #{}-params to '?'-params). So, FreeMarker is used as preprocessor for MyBatis engine.
- Author:
- elwood
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFreeMarkerSqlSource
(freemarker.template.Template template, org.apache.ibatis.session.Configuration configuration, freemarker.template.Version incompatibleImprovementsVersion) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.ibatis.mapping.BoundSql
getBoundSql
(Object parameterObject) protected Object
preProcessDataContext
(Object dataContext, boolean isMap) Populates additional parameters to data context.
-
Field Details
-
GENERATED_PARAMS_KEY
- See Also:
-
-
Constructor Details
-
FreeMarkerSqlSource
public FreeMarkerSqlSource(freemarker.template.Template template, org.apache.ibatis.session.Configuration configuration, freemarker.template.Version incompatibleImprovementsVersion)
-
-
Method Details
-
preProcessDataContext
Populates additional parameters to data context. Data context can beMap
orParamObjectAdapter
instance. -
getBoundSql
- Specified by:
getBoundSql
in interfaceorg.apache.ibatis.mapping.SqlSource
-