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

Examples of org.mybatis.generator.api.dom.java.Parameter


    method.setReturnType(returnType);

    method.setName("selectCount"
        + introspectedTable.getSelectByExampleStatementId()
            .substring(6));
    method.addParameter(new Parameter(type, "example")); //$NON-NLS-1$ 
    method.addJavaDocLine("/**");
    method.addJavaDocLine(" * @Description : 根据查询条件获取总的记录数量");
    method.addJavaDocLine(" */");

    interfaze.addImportedTypes(importedTypes);
 
View Full Code Here


    importedTypes.add(listType);
    returnType.addTypeArgument(listType);
    method.setReturnType(returnType);

    method.setName("selectByMap");
    method.addParameter(new Parameter(type, "paramMap")); //$NON-NLS-1$ 
    method.addSuppressTypeWarningsAnnotation();
    method.addJavaDocLine("/**");
    method.addJavaDocLine(" * @Description : 通过map参数进行查询");
    method.addJavaDocLine(" */");

 
View Full Code Here

    topLevelClass.addField(tmpField);

    Method setMethod = new Method();
    setMethod.setName("set" + fieldName.toUpperCase().substring(0, 1)
        + fieldName.substring(1));
    Parameter param = new Parameter(fieldType, fieldName);
    setMethod.addParameter(param);
    setMethod.setVisibility(JavaVisibility.PUBLIC);
    setMethod.addBodyLine("this." + fieldName + "=" + fieldName + ";");

    topLevelClass.addMethod(setMethod);
View Full Code Here

    addField("startIndex", intType, topLevelClass, "// 开始索引号");
    addField("pageSize", intType, topLevelClass, "// 每页大小");

    Method newConstructorMethod = new Method();
    newConstructorMethod.setConstructor(true);
    newConstructorMethod.addParameter(new Parameter(intType, "pageSize"));
    newConstructorMethod.addParameter(new Parameter(intType, "startIndex"));
    newConstructorMethod.addBodyLine("this();");
    newConstructorMethod.addBodyLine("this.pageSize=pageSize;");
    newConstructorMethod.addBodyLine("this.startIndex=startIndex;");
    newConstructorMethod.setVisibility(JavaVisibility.PUBLIC);
    newConstructorMethod.setName(topLevelClass.getType().getShortName());
View Full Code Here

      String recordLowerFullType)
  {
    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("set" + recordFullType); //$NON-NLS-1$
    method.addParameter(new Parameter(new FullyQualifiedJavaType(
        recordFullType), recordLowerFullType));
    method
        .addBodyLine("this." + recordLowerFullType + " = " + recordLowerFullType + ";"); //$NON-NLS-1$
    topLevelClass.addMethod(method);
  }
View Full Code Here

      IntrospectedTable introspectedTable)
  {
    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("setPage"); //$NON-NLS-1$
    method.addParameter(new Parameter(new FullyQualifiedJavaType(
        "com.eatle.utils.Pagination"), "page"));
    method.addBodyLine("this.page = page;"); //$NON-NLS-1$
    topLevelClass.addMethod(method);
  }
View Full Code Here

    topLevelClass.addField(tmpField);

    Method setMethod = new Method();
    setMethod.setName("set" + fieldName.toUpperCase().substring(0, 1)
        + fieldName.substring(1));
    Parameter param = new Parameter(fieldType, fieldName);
    setMethod.addParameter(param);
    setMethod.setVisibility(JavaVisibility.PUBLIC);
    setMethod.addBodyLine("this." + fieldName + "=" + fieldName + ";");

    topLevelClass.addMethod(setMethod);
View Full Code Here

    addField("startIndex", intType, topLevelClass, "// 开始索引号");
    addField("pageSize", intType, topLevelClass, "// 每页大小");

    Method newConstructorMethod = new Method();
    newConstructorMethod.setConstructor(true);
    newConstructorMethod.addParameter(new Parameter(intType, "pageSize"));
    newConstructorMethod.addParameter(new Parameter(intType, "startIndex"));
    newConstructorMethod.addBodyLine("this();");
    newConstructorMethod.addBodyLine("this.pageSize=pageSize;");
    newConstructorMethod.addBodyLine("this.startIndex=startIndex;");
    newConstructorMethod.setVisibility(JavaVisibility.PUBLIC);
    newConstructorMethod.setName(topLevelClass.getType().getShortName());
View Full Code Here

    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("findByCriteria");
    FullyQualifiedJavaType pType = new FullyQualifiedJavaType(
        introspectedTable.getExampleType());
    importedTypes.add(pType);
    method.addParameter(new Parameter(pType, "criteria"));
    method
        .addBodyLine("return " + mapperObjName + ".selectByCriteria(criteria);");
    method.addAnnotation("@Override");
    topLevelClass.addImportedTypes(importedTypes);
    topLevelClass.addMethod(method);
View Full Code Here

    importedTypes.add(returnType);
    Method method = new Method();
    method.setReturnType(returnType);
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("findById");
    method.addParameter(new Parameter(
        new FullyQualifiedJavaType("long"), "id"))
    // return userMapper.selectByPrimaryKey(id);
    method
        .addBodyLine("return " + mapperObjName + ".selectByPrimaryKey(id);");
    method.addAnnotation("@Override");
View Full Code Here

TOP

Related Classes of org.mybatis.generator.api.dom.java.Parameter

Copyright © 2018 www.massapicom. 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.