public class SqlGeneratorConfig extends Object
SqlGenerator.| Modifier and Type | Class and Description |
|---|---|
static class |
SqlGeneratorConfig.DialectConfig
Dialect configuration.
|
static class |
SqlGeneratorConfig.TemplateFileConfig
Template file configuration.
|
| Constructor and Description |
|---|
SqlGeneratorConfig() |
| Modifier and Type | Method and Description |
|---|---|
Class<? extends TemplateEngineCustomizer> |
getCustomizer()
Get the interface for customizing a default TemplateEngine instanced by the mybatis-thymeleaf.
|
SqlGeneratorConfig.DialectConfig |
getDialect()
Get a dialect configuration.
|
SqlGeneratorConfig.TemplateFileConfig |
getTemplateFile()
Get a template file configuration.
|
boolean |
isUse2way()
Get whether use the 2-way SQL feature.
|
static SqlGeneratorConfig |
newInstance()
Create an instance from default properties file.
|
static SqlGeneratorConfig |
newInstanceWithCustomizer(Consumer<SqlGeneratorConfig> customizer)
Create an instance using specified customizer and override using a default properties file.
|
static SqlGeneratorConfig |
newInstanceWithProperties(Properties customProperties)
Create an instance from specified properties.
|
static SqlGeneratorConfig |
newInstanceWithResourcePath(String resourcePath)
Create an instance from specified properties file.
|
void |
setCustomizer(Class<? extends TemplateEngineCustomizer> customizer)
Set the interface for customizing a default TemplateEngine instanced by the mybatis-thymeleaf.
|
void |
setUse2way(boolean use2way)
Set whether use the 2-way SQL feature.
|
public boolean isUse2way()
Default is true.
truepublic void setUse2way(boolean use2way)
use2way - If use the 2-way SQL feature, set truepublic Class<? extends TemplateEngineCustomizer> getCustomizer()
Default is null.
public void setCustomizer(Class<? extends TemplateEngineCustomizer> customizer)
customizer - the interface for customizing a default TemplateEnginepublic SqlGeneratorConfig.TemplateFileConfig getTemplateFile()
public SqlGeneratorConfig.DialectConfig getDialect()
public static SqlGeneratorConfig newInstance()
TemplateEngine, you can configure some property using
mybatis-thymeleaf.properties that encoded by UTF-8. Also, you can change the properties file that will read using
system property (-Dmybatis-thymeleaf.config.file=... -Dmybatis-thymeleaf.config.encoding=...). | Property Key | Description | Default |
|---|---|---|
| General configuration | ||
| use2way | Whether use the 2-way SQL | true |
| customizer | The implementation class for customizing a default TemplateEngine instanced by the MyBatis Thymeleaf
|
None |
| Template file configuration | ||
| template-file.cache-enabled | Whether use the cache feature | true |
| template-file.cache-ttl | The cache TTL for resolved templates | None(use default value of Thymeleaf) |
| template-file.encoding | The character encoding for reading template resources | "UTF-8" |
| template-file.base-dir | The base directory for reading template resources | None(just under class path) |
| template-file.patterns | The patterns for reading as template resources | "*.sql" |
| Dialect configuration | ||
| dialect.prefix | The prefix name of dialect provided by this project | "mb" |
| dialect.like-escape-char | The escape character for wildcard of LIKE | '\' (backslash) |
| dialect.like-escape-clause-format | The format of escape clause | "ESCAPE '%s'" |
| dialect.like-additional-escape-target-chars | The additional escape target characters(custom wildcard characters) for LIKE condition | None |
public static SqlGeneratorConfig newInstanceWithResourcePath(String resourcePath)
resourcePath - A property file resource pathnewInstance()public static SqlGeneratorConfig newInstanceWithProperties(Properties customProperties)
customProperties - custom configuration propertiesnewInstance()public static SqlGeneratorConfig newInstanceWithCustomizer(Consumer<SqlGeneratorConfig> customizer)
customizer - baseline customizernewInstance()Copyright © 2018–2020 MyBatis.org. All rights reserved.