org.mybatis.generator.api.dom.java.Method.addAnnotation()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(11.6k)|赞(0)|评价(0)|浏览(198)

本文整理了Java中org.mybatis.generator.api.dom.java.Method.addAnnotation()方法的一些代码示例,展示了Method.addAnnotation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Method.addAnnotation()方法的具体详情如下:
包路径:org.mybatis.generator.api.dom.java.Method
类名称:Method
方法名:addAnnotation

Method.addAnnotation介绍

暂无

代码示例

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addMapperAnnotations(Method method) {
  FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
  StringBuilder sb = new StringBuilder();
  sb.append("@DeleteProvider(type="); //$NON-NLS-1$
  sb.append(fqjt.getShortName());
  sb.append(".class, method=\""); //$NON-NLS-1$
  sb.append(introspectedTable.getDeleteByExampleStatementId());
  sb.append("\")"); //$NON-NLS-1$
  method.addAnnotation(sb.toString());
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addMapperAnnotations(Method method) {
  FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
  StringBuilder sb = new StringBuilder();
  sb.append("@UpdateProvider(type="); //$NON-NLS-1$
  sb.append(fqjt.getShortName());
  sb.append(".class, method=\""); //$NON-NLS-1$
  sb.append(introspectedTable.getUpdateByExampleWithBLOBsStatementId());
  sb.append("\")"); //$NON-NLS-1$
  method.addAnnotation(sb.toString());
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addMapperAnnotations(Method method) {
  FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
  StringBuilder sb = new StringBuilder();
  sb.append("@UpdateProvider(type="); //$NON-NLS-1$
  sb.append(fqjt.getShortName());
  sb.append(".class, method=\""); //$NON-NLS-1$
  sb.append(introspectedTable.getUpdateByExampleStatementId());
  sb.append("\")"); //$NON-NLS-1$
  method.addAnnotation(sb.toString());
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addMapperAnnotations(Method method) {
  FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
  StringBuilder sb = new StringBuilder();
  sb.append("@UpdateProvider(type="); //$NON-NLS-1$
  sb.append(fqjt.getShortName());
  sb.append(".class, method=\""); //$NON-NLS-1$
  sb.append(introspectedTable.getUpdateByPrimaryKeySelectiveStatementId());
  sb.append("\")"); //$NON-NLS-1$
  method.addAnnotation(sb.toString());
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addMapperAnnotations(Method method) {
  FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
  StringBuilder sb = new StringBuilder();
  sb.append("@SelectProvider(type="); //$NON-NLS-1$
  sb.append(fqjt.getShortName());
  sb.append(".class, method=\""); //$NON-NLS-1$
  sb.append(introspectedTable.getCountByExampleStatementId());
  sb.append("\")"); //$NON-NLS-1$
  method.addAnnotation(sb.toString());
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addMapperAnnotations(Method method) {
  FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
  StringBuilder sb = new StringBuilder();
  sb.append("@UpdateProvider(type="); //$NON-NLS-1$
  sb.append(fqjt.getShortName());
  sb.append(".class, method=\""); //$NON-NLS-1$
  sb.append(introspectedTable.getUpdateByExampleSelectiveStatementId());
  sb.append("\")"); //$NON-NLS-1$
  method.addAnnotation(sb.toString());
}

代码示例来源:origin: roncoo/roncoo-mybatis-generator

@Override
  public void addMapperAnnotations(Interface interfaze, Method method) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
    interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.DeleteProvider")); //$NON-NLS-1$
    StringBuilder sb = new StringBuilder();
    sb.append("@DeleteProvider(type="); //$NON-NLS-1$
    sb.append(fqjt.getShortName());
    sb.append(".class, method=\""); //$NON-NLS-1$
    sb.append(introspectedTable.getDeleteByExampleStatementId());
    sb.append("\")"); //$NON-NLS-1$
    
    method.addAnnotation(sb.toString());
  }
}

代码示例来源:origin: roncoo/roncoo-mybatis-generator

@Override
  public void addMapperAnnotations(Interface interfaze, Method method) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
    interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.UpdateProvider")); //$NON-NLS-1$
    StringBuilder sb = new StringBuilder();
    sb.append("@UpdateProvider(type="); //$NON-NLS-1$
    sb.append(fqjt.getShortName());
    sb.append(".class, method=\""); //$NON-NLS-1$
    sb.append(introspectedTable.getUpdateByExampleStatementId());
    sb.append("\")"); //$NON-NLS-1$
    
    method.addAnnotation(sb.toString());
  }
}

代码示例来源:origin: roncoo/roncoo-mybatis-generator

@Override
  public void addMapperAnnotations(Interface interfaze, Method method) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
    interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.UpdateProvider")); //$NON-NLS-1$
    StringBuilder sb = new StringBuilder();
    sb.append("@UpdateProvider(type="); //$NON-NLS-1$
    sb.append(fqjt.getShortName());
    sb.append(".class, method=\""); //$NON-NLS-1$
    sb.append(introspectedTable.getUpdateByPrimaryKeySelectiveStatementId());
    sb.append("\")"); //$NON-NLS-1$
    
    method.addAnnotation(sb.toString());
  }
}

代码示例来源:origin: handosme/mybatis-generator-plus

@Override
  public void addMapperAnnotations(Interface interfaze, Method method) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
    interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.UpdateProvider")); //$NON-NLS-1$
    StringBuilder sb = new StringBuilder();
    sb.append("@UpdateProvider(type="); //$NON-NLS-1$
    sb.append(fqjt.getShortName());
    sb.append(".class, method=\""); //$NON-NLS-1$
    sb.append(introspectedTable.getUpdateByExampleStatementId());
    sb.append("\")"); //$NON-NLS-1$
    
    method.addAnnotation(sb.toString());
  }
}

代码示例来源:origin: handosme/mybatis-generator-plus

@Override
  public void addMapperAnnotations(Interface interfaze, Method method) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
    interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.UpdateProvider")); //$NON-NLS-1$
    StringBuilder sb = new StringBuilder();
    sb.append("@UpdateProvider(type="); //$NON-NLS-1$
    sb.append(fqjt.getShortName());
    sb.append(".class, method=\""); //$NON-NLS-1$
    sb.append(introspectedTable.getUpdateByExampleSelectiveStatementId());
    sb.append("\")"); //$NON-NLS-1$
    
    method.addAnnotation(sb.toString());
  }
}

代码示例来源:origin: cxjava/mybatis-generator-core

@Override
  public void addMapperAnnotations(Interface interfaze, Method method) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
    interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.SelectProvider")); //$NON-NLS-1$
    StringBuilder sb = new StringBuilder();
    sb.append("@SelectProvider(type="); //$NON-NLS-1$
    sb.append(fqjt.getShortName());
    sb.append(".class, method=\""); //$NON-NLS-1$
    sb.append(introspectedTable.getCountByExampleStatementId());
    sb.append("\")"); //$NON-NLS-1$

    method.addAnnotation(sb.toString());
  }
}

代码示例来源:origin: handosme/mybatis-generator-plus

@Override
  public void addMapperAnnotations(Interface interfaze, Method method) {
    FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(introspectedTable.getMyBatis3SqlProviderType());
    interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.DeleteProvider")); //$NON-NLS-1$
    StringBuilder sb = new StringBuilder();
    sb.append("@DeleteProvider(type="); //$NON-NLS-1$
    sb.append(fqjt.getShortName());
    sb.append(".class, method=\""); //$NON-NLS-1$
    sb.append(introspectedTable.getDeleteByExampleStatementId());
    sb.append("\")"); //$NON-NLS-1$
    
    method.addAnnotation(sb.toString());
  }
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addGeneralMethodAnnotation(Method method, IntrospectedTable introspectedTable,
    Set<FullyQualifiedJavaType> imports) {
  imports.add(new FullyQualifiedJavaType("javax.annotation.Generated")); //$NON-NLS-1$
  String comment = "Source Table: " + introspectedTable.getFullyQualifiedTable().toString(); //$NON-NLS-1$
  method.addAnnotation(getGeneratedAnnotation(comment));
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

@Override
public void addGeneralMethodAnnotation(Method method, IntrospectedTable introspectedTable,
    IntrospectedColumn introspectedColumn, Set<FullyQualifiedJavaType> imports) {
  imports.add(new FullyQualifiedJavaType("javax.annotation.Generated")); //$NON-NLS-1$
  String comment = "Source field: " //$NON-NLS-1$
      + introspectedTable.getFullyQualifiedTable().toString()
      + "." //$NON-NLS-1$
      + introspectedColumn.getActualColumnName();
  method.addAnnotation(getGeneratedAnnotation(comment));
}

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

private void addResultMapAnnotation(Method method) {
  String annotation = String.format("@ResultMap(\"%s.%s\")", //$NON-NLS-1$
      introspectedTable.getMyBatis3SqlMapNamespace(),
      introspectedTable.getRules().generateResultMapWithBLOBs()
        ? introspectedTable.getResultMapWithBLOBsId() : introspectedTable.getBaseResultMapId());
  method.addAnnotation(annotation);
}

代码示例来源:origin: cxjava/mybatis-generator-core

private void addResultMapAnnotation(Interface interfaze, Method method) {
  interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.ResultMap")); //$NON-NLS-1$
  String annotation = String.format("@ResultMap(\"%s\")", //$NON-NLS-1$
      introspectedTable.getRules().generateResultMapWithBLOBs() ? introspectedTable.getResultMapWithBLOBsId()
          : introspectedTable.getBaseResultMapId());
  method.addAnnotation(annotation);
}

代码示例来源:origin: roncoo/roncoo-mybatis-generator

private void addResultMapAnnotation(Interface interfaze, Method method) {
  interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.ResultMap")); //$NON-NLS-1$
  
  String annotation = String.format("@ResultMap(\"%s\")", //$NON-NLS-1$
      introspectedTable.getRules().generateResultMapWithBLOBs() ?
          introspectedTable.getResultMapWithBLOBsId() : introspectedTable.getBaseResultMapId());
  method.addAnnotation(annotation);
}

代码示例来源:origin: handosme/mybatis-generator-plus

private void addResultMapAnnotation(Interface interfaze, Method method) {
  interfaze.addImportedType(new FullyQualifiedJavaType("org.apache.ibatis.annotations.ResultMap")); //$NON-NLS-1$
  
  String annotation = String.format("@ResultMap(\"%s\")", //$NON-NLS-1$
      introspectedTable.getRules().generateResultMapWithBLOBs() ?
          introspectedTable.getResultMapWithBLOBsId() : introspectedTable.getBaseResultMapId());
  method.addAnnotation(annotation);
}

代码示例来源: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());
}

相关文章