io.github.nichetoolkit.mybatis.MybatisHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mybatis-toolkit-context Show documentation
Show all versions of mybatis-toolkit-context Show documentation
Mybatis toolkit context project for Spring Boot
The newest version!
package io.github.nichetoolkit.mybatis;
import org.apache.ibatis.builder.annotation.ProviderContext;
import org.apache.ibatis.mapping.MappedStatement;
import org.springframework.core.io.support.SpringFactoriesLoader;
import java.util.List;
/**
* MybatisHandler
* The mybatis handler interface.
* @author Cyan ([email protected])
* @see io.github.nichetoolkit.mybatis.MybatisOrder
* @since Jdk1.8
*/
public interface MybatisHandler extends MybatisOrder {
/**
* ofHandle
* The of handle method.
* @param table {@link io.github.nichetoolkit.mybatis.MybatisTable} The table parameter is MybatisTable
type.
* @param statement {@link org.apache.ibatis.mapping.MappedStatement} The statement parameter is MappedStatement
type.
* @param context {@link org.apache.ibatis.builder.annotation.ProviderContext} The context parameter is ProviderContext
type.
* @see io.github.nichetoolkit.mybatis.MybatisTable
* @see org.apache.ibatis.mapping.MappedStatement
* @see org.apache.ibatis.builder.annotation.ProviderContext
*/
static void ofHandle(MybatisTable table, MappedStatement statement, ProviderContext context) {
for (MybatisHandler handler : Instance.handlerChain()) {
handler.handle(table, statement, context);
}
}
/**
* handle
* The handle method.
* @param table {@link io.github.nichetoolkit.mybatis.MybatisTable} The table parameter is MybatisTable
type.
* @param statement {@link org.apache.ibatis.mapping.MappedStatement} The statement parameter is MappedStatement
type.
* @param context {@link org.apache.ibatis.builder.annotation.ProviderContext} The context parameter is ProviderContext
type.
* @see io.github.nichetoolkit.mybatis.MybatisTable
* @see org.apache.ibatis.mapping.MappedStatement
* @see org.apache.ibatis.builder.annotation.ProviderContext
*/
void handle(MybatisTable table, MappedStatement statement, ProviderContext context);
/**
* Instance
* The instance class.
* @author Cyan ([email protected])
* @since Jdk1.8
*/
class Instance {
/**
* HANDLERS
* {@link java.util.List} The HANDLERS
field.
* @see java.util.List
*/
private static List HANDLERS;
/**
* handlerChain
* The handler chain method.
* @return {@link java.util.List} The handler chain return object is List
type.
* @see java.util.List
*/
public static List handlerChain() {
if (HANDLERS == null) {
HANDLERS = SpringFactoriesLoader.loadFactories(MybatisHandler.class, null);
}
return HANDLERS;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy