Examples of FullyQualifiedJavaType


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

  {
    Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);
    method.setName("add");
    FullyQualifiedJavaType type = new FullyQualifiedJavaType(
        "java.io.IOException");
    importedTypes.add(type);
    method.addException(type);

    method
View Full Code Here

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

  @Override
  public boolean modelExampleClassGenerated(TopLevelClass topLevelClass,
      IntrospectedTable introspectedTable)
  {
    FullyQualifiedJavaType intType = FullyQualifiedJavaType
        .getIntInstance();
    addField("startIndex", intType, topLevelClass, "// 开始索引号");
    addField("pageSize", intType, topLevelClass, "// 每页大小");

    Method newConstructorMethod = new Method();
View Full Code Here

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

      }
    }
  }

  private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType());
    importedTypes.add(type);

    Method method = new Method();
    method.setVisibility(getExampleMethodVisibility());
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
View Full Code Here

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

      interfaze.addMethod(method);
    }
  }

  private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType parameterType;

    if (introspectedTable.getRules().generateRecordWithBLOBsClass()) {
      parameterType = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType());
    } else {
      parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType());
    }

    importedTypes.add(parameterType);

    Method method = new Method();
View Full Code Here

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

      }
    }
  }

  private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType());
    importedTypes.add(type);
    importedTypes.add(FullyQualifiedJavaType.getNewListInstance());

    Method method = new Method();
    method.setVisibility(getExampleMethodVisibility());

    FullyQualifiedJavaType returnType = FullyQualifiedJavaType.getNewListInstance();
    if (generateForJava5) {
      FullyQualifiedJavaType fqjt;
      if (introspectedTable.getRules().generateRecordWithBLOBsClass()) {
        fqjt = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType());
      } else {
        // the blob fields must be rolled up into the base class
        fqjt = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType());
      }

      importedTypes.add(fqjt);
      returnType.addTypeArgument(fqjt);
    }
View Full Code Here

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

      }
    }
  }

  private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType());
    importedTypes.add(type);

    Method method = new Method();
    method.setVisibility(getExampleMethodVisibility());
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
View Full Code Here

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

      interfaze.addMethod(method);
    }
  }

  private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType parameterType;

    if (introspectedTable.getRules().generateRecordWithBLOBsClass()) {
      parameterType = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType());
    } else {
      parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType());
    }

    importedTypes.add(parameterType);

    Method method = new Method();
View Full Code Here

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

    StringBuilder sb = new StringBuilder();

    if (!introspectedTable.getRules().generatePrimaryKeyClass()) {
      // no primary key class, but primary key is enabled. Primary
      // key columns must be in the base class.
      FullyQualifiedJavaType keyType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType());
      topLevelClass.addImportedType(keyType);

      sb.setLength(0);
      sb.append(keyType.getShortName());
      sb.append(" _key = new "); //$NON-NLS-1$
      sb.append(keyType.getShortName());
      sb.append("();"); //$NON-NLS-1$
      method.addBodyLine(sb.toString());

      for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) {
        sb.setLength(0);
        sb.append("_key."); //$NON-NLS-1$
        sb.append(getSetterMethodName(introspectedColumn.getJavaProperty()));
        sb.append('(');
        sb.append(introspectedColumn.getJavaProperty());
        sb.append(");"); //$NON-NLS-1$
        method.addBodyLine(sb.toString());
      }
    }

    FullyQualifiedJavaType returnType = method.getReturnType();

    sb.setLength(0);
    sb.append(returnType.getShortName());
    sb.append(" record = ("); //$NON-NLS-1$
    sb.append(returnType.getShortName());
    sb.append(") "); //$NON-NLS-1$
    sb.append(daoTemplate.getQueryForObjectMethod(introspectedTable.getIbatis2SqlMapNamespace(),
        introspectedTable.getSelectByPrimaryKeyStatementId(), "_key")); //$NON-NLS-1$
    method.addBodyLine(sb.toString());
    method.addBodyLine("return record;"); //$NON-NLS-1$
View Full Code Here

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

  private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    Method method = new Method();
    method.setVisibility(JavaVisibility.PUBLIC);

    FullyQualifiedJavaType returnType = introspectedTable.getRules().calculateAllFieldsClass();
    method.setReturnType(returnType);
    importedTypes.add(returnType);

    method.setName(getDAOMethodNameCalculator().getSelectByPrimaryKeyMethodName(introspectedTable));

    if (introspectedTable.getRules().generatePrimaryKeyClass()) {
      FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getPrimaryKeyType());
      importedTypes.add(type);
      method.addParameter(new Parameter(type, "_key")); //$NON-NLS-1$
    } else {
      for (IntrospectedColumn introspectedColumn : introspectedTable.getPrimaryKeyColumns()) {
        FullyQualifiedJavaType type = introspectedColumn.getFullyQualifiedJavaType();
        importedTypes.add(type);
        method.addParameter(new Parameter(type, introspectedColumn.getJavaProperty()));
      }
    }
View Full Code Here

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

      }
    }
  }

  private Method getMethodShell(Set<FullyQualifiedJavaType> importedTypes) {
    FullyQualifiedJavaType parameterType;
    if (introspectedTable.getRules().generateRecordWithBLOBsClass()) {
      parameterType = new FullyQualifiedJavaType(introspectedTable.getRecordWithBLOBsType());
    } else {
      parameterType = new FullyQualifiedJavaType(introspectedTable.getBaseRecordType());
    }

    importedTypes.add(parameterType);

    Method method = new Method();
    method.setVisibility(getExampleMethodVisibility());
    method.setReturnType(FullyQualifiedJavaType.getIntInstance());
    method.setName(getDAOMethodNameCalculator().getUpdateByExampleWithBLOBsMethodName(introspectedTable));
    method.addParameter(new Parameter(parameterType, "record")); //$NON-NLS-1$
    method.addParameter(new Parameter(new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example")); //$NON-NLS-1$

    for (FullyQualifiedJavaType fqjt : daoTemplate.getCheckedExceptions()) {
      method.addException(fqjt);
      importedTypes.add(fqjt);
    }
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.