Package org.mybatis.generator.api.dom.java

Examples of org.mybatis.generator.api.dom.java.Method.addParameter()


    topLevelClass.addMethod(method);

    method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("setOrderByClause"); //$NON-NLS-1$
    method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "orderByClause")); //$NON-NLS-1$
    method.addBodyLine("this.orderByClause = orderByClause;"); //$NON-NLS-1$
    addSetterComment(method, OutputUtilities.lineSeparator+"\t *            排序字段", "orderByClause");
    topLevelClass.addMethod(method);

    method = new Method();
View Full Code Here


    topLevelClass.addMethod(method);

    method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("setDistinct"); //$NON-NLS-1$
    method.addParameter(new Parameter(FullyQualifiedJavaType.getBooleanPrimitiveInstance(), "distinct")); //$NON-NLS-1$
    method.addBodyLine("this.distinct = distinct;"); //$NON-NLS-1$
    addSetterComment(method, OutputUtilities.lineSeparator+"\t *            是否相异", "distinct");
    topLevelClass.addMethod(method);

    method = new Method();
View Full Code Here

    topLevelClass.addMethod(method);

    method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("setCondition"); //$NON-NLS-1$
    method.addParameter(new Parameter(types, "condition")); //$NON-NLS-1$
    method.addBodyLine("this.condition = condition;"); //$NON-NLS-1$
    method.addDeprecated();
    topLevelClass.addMethod(method);

    method = new Method();
View Full Code Here

    topLevelClass.addField(field);

    method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("setLimit"); //$NON-NLS-1$
    method.addParameter(new Parameter(FullyQualifiedJavaType.getInteger(), "limit")); //$NON-NLS-1$
    method.addBodyLine("this.limit = limit;"); //$NON-NLS-1$
    addSetterComment(method, "每页大小,即mysql中的length", "limit");
    topLevelClass.addMethod(method);

    field = new Field();
View Full Code Here

    topLevelClass.addField(field);

    method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("setStart"); //$NON-NLS-1$
    method.addParameter(new Parameter(FullyQualifiedJavaType.getInteger(), "start")); //$NON-NLS-1$
    method.addBodyLine("this.start = start;"); //$NON-NLS-1$
    addSetterComment(method, "开始行数,即mysql中的offset", "start");
    topLevelClass.addMethod(method);

    GeneratedJavaFile file = new GeneratedJavaFile(topLevelClass, context.getJavaModelGeneratorConfiguration()
View Full Code Here

          interfaze.addImportedType(criteria);
        }
        if (size == 1) {
          method.removeParameter(0);
          if (isAllInOne) {
            method.addParameter(parameter);
          } else {
            method.addParameter(parameter2);
          }
        } else if (size == 2) {
          method.removeParameter(1);
View Full Code Here

        if (size == 1) {
          method.removeParameter(0);
          if (isAllInOne) {
            method.addParameter(parameter);
          } else {
            method.addParameter(parameter2);
          }
        } else if (size == 2) {
          method.removeParameter(1);
          method.addParameter(1, parameter);
        }
View Full Code Here

          } else {
            method.addParameter(parameter2);
          }
        } else if (size == 2) {
          method.removeParameter(1);
          method.addParameter(1, parameter);
        }
        first = false;
      }
    }
View Full Code Here

    Method method = new Method();
    method.setName("selectByPrimaryKey");
    method.setReturnType(pojoType);
    if (introspectedTable.getRules().generatePrimaryKeyClass()) {
      FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType());
      method.addParameter(new Parameter(type, "key"));
    } else {
      for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) {
        FullyQualifiedJavaType type = introspectedColumn.getFullyQualifiedJavaType();
        method.addParameter(new Parameter(type, introspectedColumn.getJavaProperty()));
      }
View Full Code Here

      FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType());
      method.addParameter(new Parameter(type, "key"));
    } else {
      for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) {
        FullyQualifiedJavaType type = introspectedColumn.getFullyQualifiedJavaType();
        method.addParameter(new Parameter(type, introspectedColumn.getJavaProperty()));
      }
    }
    method.setVisibility(JavaVisibility.PUBLIC);
    StringBuilder sb = new StringBuilder();
    // method.addBodyLine("try {");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.