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

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


    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(introspectedTable.getDeleteByExampleStatementId());
    method.addParameter(new Parameter(type, "example")); //$NON-NLS-1$

    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable,"根据条件删除记录");

    addMapperAnnotations(interfaze, method);
View Full Code Here


    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(introspectedTable.getUpdateByPrimaryKeySelectiveStatementId());
    method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$

    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable,"根据主键更新属性不为空的记录");

    addMapperAnnotations(interfaze, method);
View Full Code Here

    importedTypes.add(listType);
    returnType.addTypeArgument(listType);
    method.setReturnType(returnType);
    method.setName(introspectedTable.getSelectByExampleWithBLOBsStatementId());
    method.addParameter(new Parameter(type, "example")); //$NON-NLS-1$

    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable,"根据条件查询记录集");

    addMapperAnnotations(interfaze, method);
View Full Code Here

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(introspectedTable.getCountByExampleStatementId());
    method.addParameter(new Parameter(fqjt, "example")); //$NON-NLS-1$
    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable, "根据条件查询记录总数");

    addMapperAnnotations(interfaze, method);

    if (context.getPlugins().clientCountByExampleMethodGenerated(method, interfaze, introspectedTable)) {
View Full Code Here

    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(introspectedTable.getUpdateByPrimaryKeyWithBLOBsStatementId());
    method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$

    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable, "根据主键更新记录");

    addMapperAnnotations(interfaze, method);
View Full Code Here

    method.setName(introspectedTable.getSelectByPrimaryKeyStatementId());

    if (introspectedTable.getRules().generatePrimaryKeyClass()) {
      FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType());
      importedTypes.add(type);
      method.addParameter(new Parameter(type, "key")); //$NON-NLS-1$
    } else {
      // no primary key class - fields are in the base class
      // if more than one PK field, then we need to annotate the
      // parameters
      // for MyBatis3
      List<IntrospectedColumn> introspectedColumns = introspectedTable.getPrimaryKeyColumns();
      boolean annotate = introspectedColumns.size() > 1;
      if (annotate) {
        importedTypes.add(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Param")); //$NON-NLS-1$
      }
      StringBuilder sb = new StringBuilder();
      for (IntrospectedColumn introspectedColumn : introspectedColumns) {
        FullyQualifiedJavaType type = introspectedColumn.getFullyQualifiedJavaType();
        importedTypes.add(type);
        Parameter parameter = new Parameter(type, introspectedColumn.getJavaProperty());
        if (annotate) {
          sb.setLength(0);
          sb.append("@Param(\""); //$NON-NLS-1$
          sb.append(introspectedColumn.getJavaProperty());
          sb.append("\")"); //$NON-NLS-1$
          parameter.addAnnotation(sb.toString());
        }
        method.addParameter(parameter);
      }
    }
View Full Code Here

    if (introspectedTable.getRules().generateRecordWithBLOBsClass()) {
      parameterType = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType());
    } else {
      parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType());
    }
    method.addParameter(new Parameter(parameterType, "record", "@Param(\"record\")")); //$NON-NLS-1$ //$NON-NLS-2$
    importedTypes.add(parameterType);

    FullyQualifiedJavaType exampleType = new FullyQualifiedJavaType(introspectedTable.getExampleType());
    method.addParameter(new Parameter(exampleType, "example", "@Param(\"example\")")); //$NON-NLS-1$ //$NON-NLS-2$
    importedTypes.add(exampleType);

    importedTypes.add(new FullyQualifiedJavaType("org.apache.ibatis.annotations.Param")); //$NON-NLS-1$

    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable,"根据条件更新记录");
View Full Code Here

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

    method.setName(introspectedTable.getSelectByExampleStatementId());
    method.addParameter(new Parameter(type, "example")); //$NON-NLS-1$

    context.getCommentGenerator().addGeneralMethodComment(method, introspectedTable,"根据条件查询记录集");

    addMapperAnnotations(interfaze, method);
View Full Code Here

        FullyQualifiedJavaType parameterType = introspectedTable.getRules()
                .calculateAllFieldsClass();

        importedTypes.add(parameterType);
        method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$

        for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) {
            method.addException(fqjt);
            importedTypes.add(fqjt);
        }
View Full Code Here

        String property = introspectedColumn.getJavaProperty();

        Method method = new Method();
        method.setVisibility(JavaVisibility.PUBLIC);
        method.setName(getSetterMethodName(property));
        method.addParameter(new Parameter(fqjt, property));
        context.getCommentGenerator().addSetterComment(method,
                introspectedTable, introspectedColumn);

        StringBuilder sb = new StringBuilder();
        if (isTrimStringsEnabled(context) && introspectedColumn.isStringColumn()) {
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.