Commit baf72992 authored by hewei's avatar hewei

SelectSelectivePlugin插件重构

parent 0be29103
...@@ -16,10 +16,8 @@ ...@@ -16,10 +16,8 @@
package com.itfsw.mybatis.generator.plugins; package com.itfsw.mybatis.generator.plugins;
import com.itfsw.mybatis.generator.plugins.utils.BasePlugin; import com.itfsw.mybatis.generator.plugins.utils.*;
import com.itfsw.mybatis.generator.plugins.utils.FormatTools; import com.itfsw.mybatis.generator.plugins.utils.hook.ISelectOneByExamplePluginHook;
import com.itfsw.mybatis.generator.plugins.utils.JavaElementGeneratorTools;
import com.itfsw.mybatis.generator.plugins.utils.XmlElementGeneratorTools;
import org.mybatis.generator.api.IntrospectedTable; import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.dom.java.*; import org.mybatis.generator.api.dom.java.*;
import org.mybatis.generator.api.dom.xml.Attribute; import org.mybatis.generator.api.dom.xml.Attribute;
...@@ -60,9 +58,12 @@ public class SelectOneByExamplePlugin extends BasePlugin { ...@@ -60,9 +58,12 @@ public class SelectOneByExamplePlugin extends BasePlugin {
); );
commentGenerator.addGeneralMethodComment(method, introspectedTable); commentGenerator.addGeneralMethodComment(method, introspectedTable);
// interface 增加方法 // hook
FormatTools.addMethodWithBestPosition(interfaze, method); if (PluginTools.getHook(ISelectOneByExamplePluginHook.class).clientSelectOneByExampleWithoutBLOBsMethodGenerated(method, interfaze, introspectedTable)) {
logger.debug("itfsw(查询单条数据插件):" + interfaze.getType().getShortName() + "增加selectOneByExample方法。"); // interface 增加方法
FormatTools.addMethodWithBestPosition(interfaze, method);
logger.debug("itfsw(查询单条数据插件):" + interfaze.getType().getShortName() + "增加selectOneByExample方法。");
}
// 方法生成 selectOneByExampleWithBLOBs !!! 注意这里的行为不以有没有生成Model 的 WithBLOBs类为基准 // 方法生成 selectOneByExampleWithBLOBs !!! 注意这里的行为不以有没有生成Model 的 WithBLOBs类为基准
if (introspectedTable.hasBLOBColumns()) { if (introspectedTable.hasBLOBColumns()) {
...@@ -75,9 +76,12 @@ public class SelectOneByExamplePlugin extends BasePlugin { ...@@ -75,9 +76,12 @@ public class SelectOneByExamplePlugin extends BasePlugin {
); );
commentGenerator.addGeneralMethodComment(method1, introspectedTable); commentGenerator.addGeneralMethodComment(method1, introspectedTable);
// interface 增加方法 // hook
FormatTools.addMethodWithBestPosition(interfaze, method1); if (PluginTools.getHook(ISelectOneByExamplePluginHook.class).clientSelectOneByExampleWithBLOBsMethodGenerated(method1, interfaze, introspectedTable)) {
logger.debug("itfsw(查询单条数据插件):" + interfaze.getType().getShortName() + "增加selectOneByExampleWithBLOBs方法。"); // interface 增加方法
FormatTools.addMethodWithBestPosition(interfaze, method1);
logger.debug("itfsw(查询单条数据插件):" + interfaze.getType().getShortName() + "增加selectOneByExampleWithBLOBs方法。");
}
} }
return true; return true;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package com.itfsw.mybatis.generator.plugins; package com.itfsw.mybatis.generator.plugins;
import com.itfsw.mybatis.generator.plugins.utils.*; import com.itfsw.mybatis.generator.plugins.utils.*;
import com.itfsw.mybatis.generator.plugins.utils.hook.ISelectOneByExamplePluginHook;
import org.mybatis.generator.api.IntrospectedColumn; import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.IntrospectedTable; import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.dom.java.*; import org.mybatis.generator.api.dom.java.*;
...@@ -40,7 +41,7 @@ import static org.mybatis.generator.internal.util.StringUtility.stringHasValue; ...@@ -40,7 +41,7 @@ import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
* @time:2017/6/29 13:34 * @time:2017/6/29 13:34
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
*/ */
public class SelectSelectivePlugin extends BasePlugin { public class SelectSelectivePlugin extends BasePlugin implements ISelectOneByExamplePluginHook {
public static final String METHOD_SELECT_BY_EXAMPLE_SELECTIVE = "selectByExampleSelective"; public static final String METHOD_SELECT_BY_EXAMPLE_SELECTIVE = "selectByExampleSelective";
public static final String METHOD_SELECT_BY_PRIMARY_KEY_SELECTIVE = "selectByPrimaryKeySelective"; public static final String METHOD_SELECT_BY_PRIMARY_KEY_SELECTIVE = "selectByPrimaryKeySelective";
public static final String METHOD_SELECT_ONE_BY_EXAMPLE_SELECTIVE = "selectOneByExampleSelective"; public static final String METHOD_SELECT_ONE_BY_EXAMPLE_SELECTIVE = "selectOneByExampleSelective";
...@@ -63,74 +64,83 @@ public class SelectSelectivePlugin extends BasePlugin { ...@@ -63,74 +64,83 @@ public class SelectSelectivePlugin extends BasePlugin {
return super.validate(warnings); return super.validate(warnings);
} }
/** // =========================================== client 方法生成 ===================================================
* 具体执行顺序 http://www.mybatis.org/generator/reference/pluggingIn.html
* @param interfaze
* @param topLevelClass
* @param introspectedTable
* @return
*/
@Override
public boolean clientGenerated(Interface interfaze, TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
// 找出全字段对应的Model
FullyQualifiedJavaType fullFieldModel = introspectedTable.getRules().calculateAllFieldsClass();
// 返回list类型
FullyQualifiedJavaType listType = FullyQualifiedJavaType.getNewListInstance();
listType.addTypeArgument(fullFieldModel);
// column枚举
FullyQualifiedJavaType selectiveType = new FullyQualifiedJavaType(fullFieldModel.getShortName() + "." + ModelColumnPlugin.ENUM_NAME);
// 1. selectByExampleSelective 方法 @Override
Method mSelectByExampleSelective = JavaElementGeneratorTools.generateMethod( public boolean clientSelectByExampleWithBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable) {
FormatTools.addMethodWithBestPosition(interfaze, this.replaceMethodWithSelective(
method,
METHOD_SELECT_BY_EXAMPLE_SELECTIVE, METHOD_SELECT_BY_EXAMPLE_SELECTIVE,
JavaVisibility.DEFAULT, "@Param(\"example\")",
listType, introspectedTable
new Parameter(new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example", "@Param(\"example\")"), ));
new Parameter(selectiveType, "selective", "@Param(\"selective\")", true) return super.clientSelectByExampleWithBLOBsMethodGenerated(method, interfaze, introspectedTable);
); }
commentGenerator.addGeneralMethodComment(mSelectByExampleSelective, introspectedTable);
FormatTools.addMethodWithBestPosition(interfaze, mSelectByExampleSelective);
// 2. selectByPrimaryKeySelective @Override
Method mSelectByPrimaryKeySelective = JavaElementGeneratorTools.generateMethod( public boolean clientSelectByExampleWithoutBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable) {
METHOD_SELECT_BY_PRIMARY_KEY_SELECTIVE, if (!introspectedTable.hasBLOBColumns()) {
JavaVisibility.DEFAULT, FormatTools.addMethodWithBestPosition(interfaze, this.replaceMethodWithSelective(
fullFieldModel method,
); METHOD_SELECT_BY_EXAMPLE_SELECTIVE,
"@Param(\"example\")",
introspectedTable
));
}
return super.clientSelectByExampleWithoutBLOBsMethodGenerated(method, interfaze, introspectedTable);
}
@Override
public boolean clientSelectByPrimaryKeyMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable) {
if (introspectedTable.getRules().generatePrimaryKeyClass()) { if (introspectedTable.getRules().generatePrimaryKeyClass()) {
FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType()); FormatTools.addMethodWithBestPosition(interfaze, this.replaceMethodWithSelective(
mSelectByPrimaryKeySelective.addParameter(new Parameter(type, "key", "@Param(\"record\")")); method,
METHOD_SELECT_BY_PRIMARY_KEY_SELECTIVE,
"@Param(\"record\")",
introspectedTable
));
} else { } else {
// no primary key class - fields are in the base class Method withSelective = JavaElementTools.clone(method);
// if more than one PK field, then we need to annotate the FormatTools.replaceGeneralMethodComment(commentGenerator, withSelective, introspectedTable);
// parameters
// for MyBatis3 withSelective.setName(METHOD_SELECT_BY_PRIMARY_KEY_SELECTIVE);
List<IntrospectedColumn> introspectedColumns = introspectedTable.getPrimaryKeyColumns();
withSelective.getParameters().clear();
for (IntrospectedColumn introspectedColumn : introspectedColumns) { for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) {
FullyQualifiedJavaType type = introspectedColumn.getFullyQualifiedJavaType(); withSelective.addParameter(new Parameter(introspectedColumn.getFullyQualifiedJavaType(), introspectedColumn.getJavaProperty(), "@Param(\"" + introspectedColumn.getJavaProperty() + "\")"));
Parameter parameter = new Parameter(type, introspectedColumn.getJavaProperty());
parameter.addAnnotation("@Param(\"" + introspectedColumn.getJavaProperty() + "\")");
mSelectByPrimaryKeySelective.addParameter(parameter);
} }
// selective
withSelective.addParameter(
new Parameter(this.getModelColumnFullyQualifiedJavaType(introspectedTable), "selective", "@Param(\"selective\")", true)
);
FormatTools.addMethodWithBestPosition(interfaze, withSelective);
} }
mSelectByPrimaryKeySelective.addParameter(new Parameter(selectiveType, "selective", "@Param(\"selective\")", true)); return super.clientSelectByPrimaryKeyMethodGenerated(method, interfaze, introspectedTable);
commentGenerator.addGeneralMethodComment(mSelectByPrimaryKeySelective, introspectedTable); }
FormatTools.addMethodWithBestPosition(interfaze, mSelectByPrimaryKeySelective);
// 3. selectOneByExampleSelective @Override
if (PluginTools.getPluginConfiguration(context, SelectOneByExamplePlugin.class) != null) { public boolean clientSelectOneByExampleWithBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable) {
Method mSelectOneByExampleSelective = JavaElementGeneratorTools.generateMethod( FormatTools.addMethodWithBestPosition(interfaze, this.replaceMethodWithSelective(
method,
METHOD_SELECT_ONE_BY_EXAMPLE_SELECTIVE,
"@Param(\"example\")",
introspectedTable
));
return true;
}
@Override
public boolean clientSelectOneByExampleWithoutBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable) {
if (!introspectedTable.hasBLOBColumns()) {
FormatTools.addMethodWithBestPosition(interfaze, this.replaceMethodWithSelective(
method,
METHOD_SELECT_ONE_BY_EXAMPLE_SELECTIVE, METHOD_SELECT_ONE_BY_EXAMPLE_SELECTIVE,
JavaVisibility.DEFAULT, "@Param(\"example\")",
fullFieldModel, introspectedTable
new Parameter(new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example", "@Param(\"example\")"), ));
new Parameter(selectiveType, "selective", "@Param(\"selective\")", true)
);
commentGenerator.addGeneralMethodComment(mSelectOneByExampleSelective, introspectedTable);
FormatTools.addMethodWithBestPosition(interfaze, mSelectOneByExampleSelective);
} }
return true; return true;
} }
...@@ -285,6 +295,40 @@ public class SelectSelectivePlugin extends BasePlugin { ...@@ -285,6 +295,40 @@ public class SelectSelectivePlugin extends BasePlugin {
return true; return true;
} }
// =========================================== 一些私有方法 =====================================================
/**
* 替换方法成withSelective
* @param method
* @param name
* @param firstAnnotation
* @param introspectedTable
* @return
*/
private Method replaceMethodWithSelective(Method method, String name, String firstAnnotation, IntrospectedTable introspectedTable) {
Method withSelective = JavaElementTools.clone(method);
FormatTools.replaceGeneralMethodComment(commentGenerator, withSelective, introspectedTable);
withSelective.setName(name);
// example
withSelective.getParameters().get(0).addAnnotation(firstAnnotation);
// selective
withSelective.addParameter(
new Parameter(this.getModelColumnFullyQualifiedJavaType(introspectedTable), "selective", "@Param(\"selective\")", true)
);
return withSelective;
}
/**
* 获取ModelColumn type
* @param introspectedTable
* @return
*/
private FullyQualifiedJavaType getModelColumnFullyQualifiedJavaType(IntrospectedTable introspectedTable) {
return new FullyQualifiedJavaType(introspectedTable.getRules().calculateAllFieldsClass().getShortName() + "." + ModelColumnPlugin.ENUM_NAME);
}
/** /**
* @param answer * @param answer
* @param introspectedTable * @param introspectedTable
...@@ -292,31 +336,12 @@ public class SelectSelectivePlugin extends BasePlugin { ...@@ -292,31 +336,12 @@ public class SelectSelectivePlugin extends BasePlugin {
*/ */
private void addResultMapElementsWithoutBLOBs(XmlElement answer, IntrospectedTable introspectedTable) { private void addResultMapElementsWithoutBLOBs(XmlElement answer, IntrospectedTable introspectedTable) {
for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) { for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) {
XmlElement resultElement = new XmlElement("id"); answer.addElement(XmlElementGeneratorTools.generateResultMapResultElement("id", introspectedColumn));
resultElement.addAttribute(new Attribute("column", MyBatis3FormattingUtilities.getRenamedColumnNameForResultMap(introspectedColumn)));
resultElement.addAttribute(new Attribute("property", introspectedColumn.getJavaProperty()));
resultElement.addAttribute(new Attribute("jdbcType", introspectedColumn.getJdbcTypeName()));
if (stringHasValue(introspectedColumn.getTypeHandler())) {
resultElement.addAttribute(new Attribute("typeHandler", introspectedColumn.getTypeHandler()));
}
answer.addElement(resultElement);
} }
List<IntrospectedColumn> columns = introspectedTable.getBaseColumns(); List<IntrospectedColumn> columns = introspectedTable.getBaseColumns();
for (IntrospectedColumn introspectedColumn : columns) { for (IntrospectedColumn introspectedColumn : columns) {
XmlElement resultElement = new XmlElement("result"); answer.addElement(XmlElementGeneratorTools.generateResultMapResultElement("result", introspectedColumn));
resultElement.addAttribute(new Attribute("column", MyBatis3FormattingUtilities.getRenamedColumnNameForResultMap(introspectedColumn)));
resultElement.addAttribute(new Attribute("property", introspectedColumn.getJavaProperty()));
resultElement.addAttribute(new Attribute("jdbcType", introspectedColumn.getJdbcTypeName()));
if (stringHasValue(introspectedColumn.getTypeHandler())) {
resultElement.addAttribute(new Attribute("typeHandler", introspectedColumn.getTypeHandler()));
}
answer.addElement(resultElement);
} }
} }
...@@ -327,15 +352,7 @@ public class SelectSelectivePlugin extends BasePlugin { ...@@ -327,15 +352,7 @@ public class SelectSelectivePlugin extends BasePlugin {
*/ */
private void addResultMapElementsWithBLOBs(XmlElement answer, IntrospectedTable introspectedTable) { private void addResultMapElementsWithBLOBs(XmlElement answer, IntrospectedTable introspectedTable) {
for (IntrospectedColumn introspectedColumn : introspectedTable.getBLOBColumns()) { for (IntrospectedColumn introspectedColumn : introspectedTable.getBLOBColumns()) {
XmlElement resultElement = new XmlElement("result"); answer.addElement(XmlElementGeneratorTools.generateResultMapResultElement("result", introspectedColumn));
resultElement.addAttribute(new Attribute("column", MyBatis3FormattingUtilities.getRenamedColumnNameForResultMap(introspectedColumn)));
resultElement.addAttribute(new Attribute("property", introspectedColumn.getJavaProperty()));
resultElement.addAttribute(new Attribute("jdbcType", introspectedColumn.getJdbcTypeName()));
if (stringHasValue(introspectedColumn.getTypeHandler())) {
resultElement.addAttribute(new Attribute("typeHandler", introspectedColumn.getTypeHandler()));
}
answer.addElement(resultElement);
} }
} }
} }
/*
* Copyright (c) 2018.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.itfsw.mybatis.generator.plugins.utils;
import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;
import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.java.Parameter;
import org.mybatis.generator.api.dom.java.TypeParameter;
/**
* ---------------------------------------------------------------------------
*
* ---------------------------------------------------------------------------
* @author: hewei
* @time:2018/5/7 18:14
* ---------------------------------------------------------------------------
*/
public class JavaElementTools {
/**
* clone
* @param method
* @return
*/
public static Method clone(Method method) {
Method dest = new Method(method.getName());
// 注解
for (String javaDocLine : method.getJavaDocLines()) {
dest.addJavaDocLine(javaDocLine);
}
dest.setReturnType(method.getReturnType());
for (Parameter parameter : method.getParameters()) {
dest.addParameter(JavaElementTools.clone(parameter));
}
for (FullyQualifiedJavaType exception : method.getExceptions()) {
dest.addException(exception);
}
for (TypeParameter typeParameter : method.getTypeParameters()) {
dest.addTypeParameter(typeParameter);
}
dest.addBodyLines(method.getBodyLines());
dest.setConstructor(method.isConstructor());
dest.setNative(method.isNative());
dest.setSynchronized(method.isSynchronized());
dest.setDefault(method.isDefault());
dest.setFinal(method.isFinal());
dest.setStatic(method.isStatic());
dest.setVisibility(method.getVisibility());
return dest;
}
/**
* clone
* @param parameter
* @return
*/
public static Parameter clone(Parameter parameter) {
Parameter dest = new Parameter(parameter.getType(), parameter.getName(), parameter.isVarargs());
for (String annotation : parameter.getAnnotations()) {
dest.addAnnotation(annotation);
}
return dest;
}
}
...@@ -32,6 +32,8 @@ import java.util.Arrays; ...@@ -32,6 +32,8 @@ import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
/** /**
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
* Xml 节点生成工具 参考 org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.AbstractXmlElementGenerator * Xml 节点生成工具 参考 org.mybatis.generator.codegen.mybatis3.xmlmapper.elements.AbstractXmlElementGenerator
...@@ -543,4 +545,23 @@ public class XmlElementGeneratorTools { ...@@ -543,4 +545,23 @@ public class XmlElementGeneratorTools {
} }
return false; return false;
} }
/**
* 生成resultMap的result 节点
* @param name
* @param introspectedColumn
* @return
*/
public static XmlElement generateResultMapResultElement(String name, IntrospectedColumn introspectedColumn) {
XmlElement resultElement = new XmlElement(name);
resultElement.addAttribute(new Attribute("column", MyBatis3FormattingUtilities.getRenamedColumnNameForResultMap(introspectedColumn)));
resultElement.addAttribute(new Attribute("property", introspectedColumn.getJavaProperty()));
resultElement.addAttribute(new Attribute("jdbcType", introspectedColumn.getJdbcTypeName()));
if (stringHasValue(introspectedColumn.getTypeHandler())) {
resultElement.addAttribute(new Attribute("typeHandler", introspectedColumn.getTypeHandler()));
}
return resultElement;
}
} }
...@@ -42,7 +42,7 @@ import java.util.List; ...@@ -42,7 +42,7 @@ import java.util.List;
* @time:2018/4/27 11:33 * @time:2018/4/27 11:33
* --------------------------------------------------------------------------- * ---------------------------------------------------------------------------
*/ */
public class HookAggregator implements IUpsertPluginHook, IModelBuilderPluginHook, IIncrementsPluginHook, IOptimisticLockerPluginHook { public class HookAggregator implements IUpsertPluginHook, IModelBuilderPluginHook, IIncrementsPluginHook, IOptimisticLockerPluginHook, ISelectOneByExamplePluginHook {
protected static final Logger logger = LoggerFactory.getLogger(BasePlugin.class); // 日志 protected static final Logger logger = LoggerFactory.getLogger(BasePlugin.class); // 日志
private final static HookAggregator instance = new HookAggregator(); private final static HookAggregator instance = new HookAggregator();
private Context context; private Context context;
...@@ -207,4 +207,27 @@ public class HookAggregator implements IUpsertPluginHook, IModelBuilderPluginHoo ...@@ -207,4 +207,27 @@ public class HookAggregator implements IUpsertPluginHook, IModelBuilderPluginHoo
return this.getPlugins(IOptimisticLockerPluginHook.class).get(0).generateSetsSelectiveElement(columns, versionColumn, setsElement); return this.getPlugins(IOptimisticLockerPluginHook.class).get(0).generateSetsSelectiveElement(columns, versionColumn, setsElement);
} }
} }
// ============================================= ISelectOneByExamplePluginHook ==============================================
@Override
public boolean clientSelectOneByExampleWithBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable) {
for (ISelectOneByExamplePluginHook plugin : this.getPlugins(ISelectOneByExamplePluginHook.class)) {
if (!plugin.clientSelectOneByExampleWithBLOBsMethodGenerated(method, interfaze, introspectedTable)) {
return false;
}
}
return true;
}
@Override
public boolean clientSelectOneByExampleWithoutBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable) {
for (ISelectOneByExamplePluginHook plugin : this.getPlugins(ISelectOneByExamplePluginHook.class)) {
if (!plugin.clientSelectOneByExampleWithoutBLOBsMethodGenerated(method, interfaze, introspectedTable)) {
return false;
}
}
return true;
}
} }
/*
* Copyright (c) 2018.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.itfsw.mybatis.generator.plugins.utils.hook;
import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.dom.java.Interface;
import org.mybatis.generator.api.dom.java.Method;
/**
* ---------------------------------------------------------------------------
*
* ---------------------------------------------------------------------------
* @author: hewei
* @time:2018/5/7 18:51
* ---------------------------------------------------------------------------
*/
public interface ISelectOneByExamplePluginHook {
/**
* selectOneByExampleWithBLOBs 接口方法生成
* @param method
* @param interfaze
* @param introspectedTable
* @return
*/
boolean clientSelectOneByExampleWithBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable);
/**
* selectOneByExample 接口方法生成
* @param method
* @param interfaze
* @param introspectedTable
* @return
*/
boolean clientSelectOneByExampleWithoutBLOBsMethodGenerated(Method method, Interface interfaze, IntrospectedTable introspectedTable);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment