public class TemplateFilePathProvider extends Object
SelectProvider as follow:
package com.example.mapper;
public interface BaseMapper<T> {
@Options(useGeneratedKeys = true, keyProperty = "id")
@InsertProvider(type = TemplateFilePathProvider.class)
void insert(T entity);
@UpdateProvider(type = TemplateFilePathProvider.class)
void update(T entity);
@DeleteProvider(type = TemplateFilePathProvider.class)
void delete(T entity);
@SelectProvider(type = TemplateFilePathProvider.class)
T findById(Integer id);
}
package com.example.mapper;
public interface NameMapper extends BaseMapper {
@SelectProvider(type = TemplateFilePathProvider.class)
List<Name> findByConditions(NameConditions conditions);
}
| Modifier and Type | Class and Description |
|---|---|
static interface |
TemplateFilePathProvider.PathGenerator
The interface that implements a function for generating template file path.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCache()
Clear cache.
|
static String |
provideSql(org.apache.ibatis.builder.annotation.ProviderContext context)
Provide an SQL scripting string(template file path).
|
static void |
setCustomTemplateFilePathGenerator(TemplateFilePathProvider.PathGenerator pathGenerator)
Set custom implementation for
TemplateFilePathProvider.PathGenerator. |
static void |
setLanguageDriverConfig(ThymeleafLanguageDriverConfig languageDriverConfig)
Set a configuration instance for
ThymeleafLanguageDriver. |
public static void setCustomTemplateFilePathGenerator(TemplateFilePathProvider.PathGenerator pathGenerator)
TemplateFilePathProvider.PathGenerator.pathGenerator - a instance for generating a template file pathpublic static void setLanguageDriverConfig(ThymeleafLanguageDriverConfig languageDriverConfig)
ThymeleafLanguageDriver.
By default, ThymeleafLanguageDriverConfig.newInstance() will used.
If you applied an user define ThymeleafLanguageDriverConfig for ThymeleafLanguageDriver, please
same instance to the this class.
languageDriverConfig - A user defined ThymeleafLanguageDriverConfigpublic static String provideSql(org.apache.ibatis.builder.annotation.ProviderContext context)
context - a context of SQL providerpublic static void clearCache()
Copyright © 2018–2020 MyBatis.org. All rights reserved.