本文整理了Java中org.mybatis.generator.api.dom.java.Method.addParameter()
方法的一些代码示例,展示了Method.addParameter()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Method.addParameter()
方法的具体详情如下:
包路径:org.mybatis.generator.api.dom.java.Method
类名称:Method
方法名:addParameter
[英]Adds the parameter.
[中]添加参数。
代码示例来源:origin: shuzheng/zheng
setLimit.setVisibility(JavaVisibility.PUBLIC);
setLimit.setName("setLimit");
setLimit.addParameter(new Parameter(integerWrapper, "limit"));
setLimit.addBodyLine("this.limit = limit;");
topLevelClass.addMethod(setLimit);
setOffset.setVisibility(JavaVisibility.PUBLIC);
setOffset.setName("setOffset");
setOffset.addParameter(new Parameter(integerWrapper, "offset"));
setOffset.addBodyLine("this.offset = offset;");
topLevelClass.addMethod(setOffset);
代码示例来源:origin: jmdhappy/xxpay-master
setLimit.setVisibility(JavaVisibility.PUBLIC);
setLimit.setName("setLimit");
setLimit.addParameter(new Parameter(integerWrapper, "limit"));
setLimit.addBodyLine("this.limit = limit;");
topLevelClass.addMethod(setLimit);
setOffset.setVisibility(JavaVisibility.PUBLIC);
setOffset.setName("setOffset");
setOffset.addParameter(new Parameter(integerWrapper, "offset"));
setOffset.addBodyLine("this.offset = offset;");
topLevelClass.addMethod(setOffset);
代码示例来源:origin: jmdhappy/xxpay-master
setLimit.setVisibility(JavaVisibility.PUBLIC);
setLimit.setName("setLimit");
setLimit.addParameter(new Parameter(integerWrapper, "limit"));
setLimit.addBodyLine("this.limit = limit;");
topLevelClass.addMethod(setLimit);
setOffset.setVisibility(JavaVisibility.PUBLIC);
setOffset.setName("setOffset");
setOffset.addParameter(new Parameter(integerWrapper, "offset"));
setOffset.addBodyLine("this.offset = offset;");
topLevelClass.addMethod(setOffset);
代码示例来源:origin: sanluan/PublicCMS
topLevelClazz.addImportedType(t);
if ("RowBounds".equals(t.getShortNameWithoutTypeArguments())) {
m.addParameter(new Parameter(new FullyQualifiedJavaType("long"), "pageIndex"));
m.addParameter(new Parameter(FullyQualifiedJavaType.getIntInstance(), "pageSize"));
paramTxt.add("new RowBounds((pageIndex - 1) * pageSize, pageSize)");
} else {
Parameter tmp = new Parameter(t, p.getName());
m.addParameter(tmp);
paramTxt.add(tmp.getName());
topLevelClazz.addImportedType(t);
Parameter tmp = new Parameter(t, p.getName());
m.addParameter(tmp);
paramTxt.add(tmp.getName());
代码示例来源:origin: oceanc/mybatis3-generator-plugins
public static Method makeSetterStringMethod(Context context, String fieldName, FullyQualifiedJavaType fieldType, String tableName) {
String methodName = "set" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1, fieldName.length());
Method method = new Method();
method.setName(methodName);
method.setVisibility(JavaVisibility.PUBLIC);
method.addParameter(new Parameter(fieldType, fieldName));
method.addBodyLine("this." + fieldName + " = " + fieldName + ";");
addDoc(context, method, tableName);
return method;
}
代码示例来源:origin: oceanc/mybatis3-generator-plugins
private Method makePartitionMethod(FullyQualifiedJavaType paramType, FullyQualifiedJavaType returnType, String fieldName, String tableName, String[] exp) {
String methodName = PARTITION_FACTOR + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1, fieldName.length());
Method method = new Method();
method.setName(methodName);
method.setVisibility(JavaVisibility.PUBLIC);
method.setReturnType(returnType);
method.addBodyLines(Arrays.asList(exp));
method.addParameter(new Parameter(paramType, fieldName));
PluginUtils.addDoc(this.getContext(), method, tableName);
return method;
}
代码示例来源:origin: cxjava/mybatis-generator-core
@Override
public boolean clientGenerated(Interface interfaze, TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
Method method = topLevelClass.getMethods().get(0);
addAnnotation(topLevelClass, method);
method.addParameter(new Parameter(sqlMapClient, "sqlMapClient"));
method.removeBodyLine(0);
method.addBodyLine("super.setSqlMapClient(sqlMapClient);");
return true;
}
代码示例来源:origin: org.mybatis.generator/mybatis-generator-core
@Override
protected void configureConstructorTemplate() {
Method method = new Method();
method.setConstructor(true);
method.setVisibility(JavaVisibility.PUBLIC);
method.addParameter(new Parameter(fqjt, "daoManager")); //$NON-NLS-1$
method.addBodyLine("super(daoManager);"); //$NON-NLS-1$
setConstructorTemplate(method);
}
代码示例来源:origin: roncoo/roncoo-mybatis-generator
@Override
protected void configureConstructorTemplate() {
Method method = new Method();
method.setConstructor(true);
method.setVisibility(JavaVisibility.PUBLIC);
method.addParameter(new Parameter(fqjt, "daoManager")); //$NON-NLS-1$
method.addBodyLine("super(daoManager);"); //$NON-NLS-1$
setConstructorTemplate(method);
}
代码示例来源:origin: handosme/mybatis-generator-plus
@Override
protected void configureConstructorTemplate() {
Method method = new Method();
method.setConstructor(true);
method.setVisibility(JavaVisibility.PUBLIC);
method.addParameter(new Parameter(fqjt, "daoManager")); //$NON-NLS-1$
method.addBodyLine("super(daoManager);"); //$NON-NLS-1$
setConstructorTemplate(method);
}
代码示例来源:origin: cxjava/mybatis-generator-core
@Override
protected void configureConstructorTemplate() {
Method method = new Method();
method.setConstructor(true);
method.setVisibility(JavaVisibility.PUBLIC);
method.addParameter(new Parameter(fqjt, "daoManager")); //$NON-NLS-1$
method.addBodyLine("super(daoManager);"); //$NON-NLS-1$
setConstructorTemplate(method);
}
代码示例来源:origin: org.mybatis.generator/mybatis-generator-core
protected void acceptParts(MethodAndImports.Builder builder, Method method, MethodParts methodParts) {
for (Parameter parameter : methodParts.getParameters()) {
method.addParameter(parameter);
}
for (String annotation : methodParts.getAnnotations()) {
method.addAnnotation(annotation);
}
method.addBodyLines(methodParts.getBodyLines());
builder.withImports(methodParts.getImports());
}
代码示例来源:origin: org.mybatis.generator/mybatis-generator-core
@Override
protected void configureConstructorTemplate() {
Method constructor = new Method();
constructor.setConstructor(true);
constructor.setVisibility(JavaVisibility.PUBLIC);
constructor
.addParameter(new Parameter(sqlMapClientType, "sqlMapClient")); //$NON-NLS-1$
constructor.addBodyLine("super();"); //$NON-NLS-1$
constructor.addBodyLine("this.sqlMapClient = sqlMapClient;"); //$NON-NLS-1$
setConstructorTemplate(constructor);
}
代码示例来源:origin: roncoo/roncoo-mybatis-generator
@Override
protected void configureConstructorTemplate() {
Method constructor = new Method();
constructor.setConstructor(true);
constructor.setVisibility(JavaVisibility.PUBLIC);
constructor
.addParameter(new Parameter(sqlMapClientType, "sqlMapClient")); //$NON-NLS-1$
constructor.addBodyLine("super();"); //$NON-NLS-1$
constructor.addBodyLine("this.sqlMapClient = sqlMapClient;"); //$NON-NLS-1$
setConstructorTemplate(constructor);
}
代码示例来源:origin: handosme/mybatis-generator-plus
@Override
protected void configureConstructorTemplate() {
Method constructor = new Method();
constructor.setConstructor(true);
constructor.setVisibility(JavaVisibility.PUBLIC);
constructor
.addParameter(new Parameter(sqlMapClientType, "sqlMapClient")); //$NON-NLS-1$
constructor.addBodyLine("super();"); //$NON-NLS-1$
constructor.addBodyLine("this.sqlMapClient = sqlMapClient;"); //$NON-NLS-1$
setConstructorTemplate(constructor);
}
代码示例来源:origin: beihaifeiwu/dolphin
protected void generateSetterFor(String field, FullyQualifiedJavaType type, InnerClass innerClass) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setName("set" + capitalize(field));
method.addParameter(new Parameter(type, field));
method.addBodyLine("this." + field + " = " + field + ";");
innerClass.addMethod(method);
}
代码示例来源:origin: cxjava/mybatis-generator-core
@Override
protected void configureConstructorTemplate() {
Method constructor = new Method();
constructor.setConstructor(true);
constructor.setVisibility(JavaVisibility.PUBLIC);
constructor.addParameter(new Parameter(sqlMapClientType, "sqlMapClient")); //$NON-NLS-1$
constructor.addBodyLine("super();"); //$NON-NLS-1$
constructor.addBodyLine("this.sqlMapClient = sqlMapClient;"); //$NON-NLS-1$
setConstructorTemplate(constructor);
}
代码示例来源:origin: beihaifeiwu/dolphin
@Override
public boolean clientGenerated(Interface interfaze, TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
String objectName = introspectedTable.getTableConfiguration().getDomainObjectName();
Method method = new Method(BATCH_INSERT);
FullyQualifiedJavaType type = new FullyQualifiedJavaType("java.util.List<" + objectName + ">");
method.addParameter(new Parameter(type, "list"));
method.setReturnType(FullyQualifiedJavaType.getIntInstance());
interfaze.addMethod(method);
return true;
}
代码示例来源:origin: beihaifeiwu/dolphin
protected void generateFluentSetterFor(String field, FullyQualifiedJavaType type, InnerClass innerClass) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setName(field);
method.addParameter(new Parameter(type, field));
method.addBodyLine("this." + field + " = " + field + ";");
method.addBodyLine("return this;");
method.setReturnType(innerClass.getType());
innerClass.addMethod(method);
}
代码示例来源:origin: org.mybatis.generator/mybatis-generator-core
private void addNewComposedFunction(Interface interfaze, IntrospectedTable introspectedTable, FullyQualifiedJavaType baseMethodReturnType) {
interfaze.addImportedType(new FullyQualifiedJavaType("java.util.function.Function")); //$NON-NLS-1$
FullyQualifiedJavaType returnType = new FullyQualifiedJavaType("Function<SelectStatementProvider, " //$NON-NLS-1$
+ baseMethodReturnType.getShortName() + ">"); //$NON-NLS-1$
Method method = new Method("selectManyWithRowbounds"); //$NON-NLS-1$
method.setDefault(true);
method.setReturnType(returnType);
method.addParameter(new Parameter(rowBounds, "rowBounds")); //$NON-NLS-1$
method.addBodyLine("return selectStatement -> selectManyWithRowbounds(selectStatement, rowBounds);"); //$NON-NLS-1$
context.getCommentGenerator().addGeneralMethodAnnotation(method, introspectedTable, interfaze.getImportedTypes());
interfaze.addMethod(method);
}
内容来源于网络,如有侵权,请联系作者删除!