![JAR search and dependency download from the Maven repository](/logo.png)
me.aifaq.mybatis.generator.plugins.ForceSkipMergeSqlMapPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mybatis-generator-ext Show documentation
Show all versions of mybatis-generator-ext Show documentation
extension for mybatis-generator
package me.aifaq.mybatis.generator.plugins;
import org.mybatis.generator.api.GeneratedXmlFile;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import java.lang.reflect.Field;
import java.util.List;
/**
* 强制跳过merge sql map.xml
*
* @author Wang Wei
* @since 14:52 2017/5/17
*/
public class ForceSkipMergeSqlMapPlugin extends PluginAdapter {
@Override
public boolean validate(List warnings) {
return true;
}
@Override
public boolean sqlMapGenerated(GeneratedXmlFile sqlMap, IntrospectedTable introspectedTable) {
try {
Field field = sqlMap.getClass().getDeclaredField("isMergeable");
field.setAccessible(true);
field.set(sqlMap, false);
}
catch (Exception ignore) {}
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy