当前位置: 首页>>代码示例>>Java>>正文


Java IntrospectedColumn.getRemarks方法代码示例

本文整理汇总了Java中org.mybatis.generator.api.IntrospectedColumn.getRemarks方法的典型用法代码示例。如果您正苦于以下问题:Java IntrospectedColumn.getRemarks方法的具体用法?Java IntrospectedColumn.getRemarks怎么用?Java IntrospectedColumn.getRemarks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mybatis.generator.api.IntrospectedColumn的用法示例。


在下文中一共展示了IntrospectedColumn.getRemarks方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addFieldComment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
public void addFieldComment(Field field,
                            IntrospectedTable introspectedTable,
                            IntrospectedColumn introspectedColumn) {
    if (suppressAllComments) {
        return;
    }

    String remarks = introspectedColumn.getRemarks();

    if (!StringUtility.stringHasValue(remarks)) {
        return;
    }

    field.addJavaDocLine("/**"); //$NON-NLS-1$

    String lineSep = System.getProperty("line.separator");
    if (StringUtility.stringHasValue(remarks)) {
        String[] remarkLines = remarks.split(lineSep);  //$NON-NLS-1$
        for (String remarkLine : remarkLines) {
            field.addJavaDocLine(" *   " + remarkLine);  //$NON-NLS-1$
        }
    }

    field.addJavaDocLine(" */"); //$NON-NLS-1$
}
 
开发者ID:comboent,项目名称:mbg-extend,代码行数:26,代码来源:SimpleCommentGenerator.java

示例2: addFieldComment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
public void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
    if (!this.suppressAllComments) {
        field.addJavaDocLine("/**");
        String remarks = introspectedColumn.getRemarks();
        if (this.addRemarkComments && StringUtility.stringHasValue(remarks)) {
            field.addJavaDocLine(" * Database Column Remarks:");
            String[] remarkLines = remarks.split(System.getProperty("line.separator"));
            String[] var6 = remarkLines;
            int var7 = remarkLines.length;

            for (int var8 = 0; var8 < var7; ++var8) {
                String remarkLine = var6[var8];
                field.addJavaDocLine(" *   " + remarkLine);
            }
        }

        field.addJavaDocLine(" *");
        field.addJavaDocLine(" * This field was generated by MyBatis Generator.");
        StringBuilder sb = new StringBuilder();
        sb.append(" * This field corresponds to the database column ");
        sb.append(introspectedTable.getFullyQualifiedTable());
        sb.append('.');
        sb.append(introspectedColumn.getActualColumnName());
        field.addJavaDocLine(sb.toString());
        this.addJavadocTag(field, false);
        field.addJavaDocLine(" */");
    }
}
 
开发者ID:ychaoyang,项目名称:autotest,代码行数:29,代码来源:DefaultCommentGenerator.java

示例3: addFieldComment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
public void addFieldComment(Field field,
        IntrospectedTable introspectedTable,
        IntrospectedColumn introspectedColumn) {
    if (suppressAllComments) {
        return;
    }

    field.addJavaDocLine("/**"); //$NON-NLS-1$

    String remarks = introspectedColumn.getRemarks();
    if (addRemarkComments && StringUtility.stringHasValue(remarks)) {
        field.addJavaDocLine(" * Database Column Remarks:");
        String[] remarkLines = remarks.split(System.getProperty("line.separator"));  //$NON-NLS-1$
        for (String remarkLine : remarkLines) {
            field.addJavaDocLine(" *   " + remarkLine);  //$NON-NLS-1$
        }
    }

    field.addJavaDocLine(" *"); //$NON-NLS-1$
    field
            .addJavaDocLine(" * This field was generated by MyBatis Generator."); //$NON-NLS-1$

    StringBuilder sb = new StringBuilder();
    sb.append(" * This field corresponds to the database column "); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable());
    sb.append('.');
    sb.append(introspectedColumn.getActualColumnName());
    field.addJavaDocLine(sb.toString());

    addJavadocTag(field, false);

    field.addJavaDocLine(" */"); //$NON-NLS-1$
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:34,代码来源:DefaultCommentGenerator.java

示例4: addFieldComment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
@Override
public void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
    // 添加字段注释
    StringBuffer sb = new StringBuffer();
    field.addJavaDocLine("/**");
    if (introspectedColumn.getRemarks() != null)
        field.addJavaDocLine(" * " + introspectedColumn.getRemarks());
    sb.append(" * 表字段 : ");
    sb.append(introspectedTable.getFullyQualifiedTable());
    sb.append('.');
    sb.append(introspectedColumn.getActualColumnName());
    field.addJavaDocLine(sb.toString());
    // addJavadocTag(field, false);
    field.addJavaDocLine(" */");
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:16,代码来源:BDTCommentGenerator.java

示例5: addFieldComment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
@Override
public void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
	super.addFieldComment(field, introspectedTable, introspectedColumn);
	if (introspectedColumn.getRemarks() != null && !introspectedColumn.getRemarks().equals("")) {
		field.addJavaDocLine("/**");
		field.addJavaDocLine(" * " + introspectedColumn.getRemarks());
		addJavadocTag(field, false);
		field.addJavaDocLine(" */");
	}
}
 
开发者ID:youngMen1,项目名称:-Spring-SpringMVC-Mybatis-,代码行数:11,代码来源:CommentGenerator.java

示例6: modelGetterMethodGenerated

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * 解析处理注释,增加 getXxxText() 方法
 *    注释格式范例:
 *      @enum 0: 有效期; 1: 无效
 */
@Override
public boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass,
                                          IntrospectedColumn introspectedColumn,
                                          IntrospectedTable introspectedTable,
                                          ModelClassType modelClassType) {

    String remarks = introspectedColumn.getRemarks();
    int jdbcType = introspectedColumn.getJdbcType();

    remarks = StringUtils.trimToNull(remarks);

    if (remarks == null) {
        return true;
    }

    if (!remarks.contains("@enum")) {
        return true;
    }

    String annotation = remarks.substring(remarks.indexOf("@enum") + 5);
    String[] items = StringUtils.split(annotation, ';');

    StringBuilder mapInitSb = new StringBuilder("new HashMap<Object, String>(){{");
    for (String item : items) {
        if (!item.contains(":")) {
            continue;
        }
        String[] kv = item.split(":");
        String k = StringUtils.trim(kv[0]);
        String v = StringUtils.trim(kv[1]);
        mapInitSb.append("put(");
        if (jdbcType == Types.TINYINT) {
            mapInitSb.append("(byte)");
        }
        mapInitSb.append(k).append(",")
                .append("\"").append(v).append("\");");
    }
    mapInitSb.append("}}");

    // 增加常量
    String fieldName = String.format("%sMap", introspectedColumn.getJavaProperty());

    Field field = new Field(
            fieldName,
            new FullyQualifiedJavaType("java.util.HashMap<Object, String>")
    );
    field.setVisibility(JavaVisibility.PRIVATE);
    field.setStatic(true);
    field.setFinal(true);
    field.setInitializationString(mapInitSb.toString());

    topLevelClass.addField(field);


    // 增加方法
    Method textMethod = new Method(String.format("%sText", method.getName()));
    textMethod.setReturnType(new FullyQualifiedJavaType(String.class.getCanonicalName()));
    textMethod.setVisibility(JavaVisibility.PUBLIC);
    if (jdbcType == Types.TINYINT) {
        textMethod.addBodyLine(String.format("return %s.get((byte)this.%s);", fieldName, introspectedColumn.getJavaProperty()));
    } else {
        textMethod.addBodyLine(String.format("return %s.get(this.%s);", fieldName, introspectedColumn.getJavaProperty()));
    }

    remarks = remarks.replaceAll("\n", "\\\\n").replaceAll("\"", "\\\\\"");
    textMethod.addAnnotation(
        String.format("@ApiModelProperty(value = \"%s\")", remarks)
    );

    topLevelClass.addImportedType(new FullyQualifiedJavaType(HashMap.class.getCanonicalName()));
    topLevelClass.addMethod(textMethod);

    return true;
}
 
开发者ID:yinheli,项目名称:mybatis-generator-tool,代码行数:80,代码来源:StatusTextPlugin.java

示例7: modelFieldGenerated

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
@Override
public boolean modelFieldGenerated(Field field, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn,
                                   IntrospectedTable introspectedTable, ModelClassType modelClassType) {
    topLevelClass.addImportedType(new FullyQualifiedJavaType(ApiModelProperty.class.getCanonicalName()));
    String remarks = introspectedColumn.getRemarks();
    remarks = remarks.replaceAll("\n", "\\\\n").replaceAll("\"", "\\\\\"");
    String annoation = String.format("@ApiModelProperty(value = \"%s\")", remarks);
    field.addAnnotation(annoation);
    return comment(field, introspectedTable, introspectedColumn);
}
 
开发者ID:yinheli,项目名称:mybatis-generator-tool,代码行数:11,代码来源:CommentPlugin.java

示例8: comment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
private boolean comment(JavaElement element, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
    element.getJavaDocLines().clear();
    element.addJavaDocLine("/**");
    String remark = introspectedColumn.getRemarks();
    if (remark != null && remark.length() > 1) {
        element.addJavaDocLine(" * " + remark);
        element.addJavaDocLine(" *");
    }
    element.addJavaDocLine(" * Table:     " + introspectedTable.getFullyQualifiedTable());
    element.addJavaDocLine(" * Column:    " + introspectedColumn.getActualColumnName());
    element.addJavaDocLine(" * Nullable:  " + introspectedColumn.isNullable());
    element.addJavaDocLine(" */");

    return true;
}
 
开发者ID:yinheli,项目名称:mybatis-generator-tool,代码行数:16,代码来源:CommentPlugin.java

示例9: addFieldComment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * 给 Model 中的字段添加数据库备注
 */
@Override
public void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
    field.addJavaDocLine("/**");
    if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
        String remark = introspectedColumn.getRemarks();
        String[] remarks = remark.split("\r\n");
        for (String s : remarks) {
            field.addJavaDocLine(" * " + s);
        }
    }
    ElementHelper.addMergeTag(field, false);
    field.addJavaDocLine(" */");
}
 
开发者ID:drtrang,项目名称:mybatis-generator-extension,代码行数:17,代码来源:CommentGenerator.java

示例10: addFieldComment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
@Override
public void addFieldComment(Field field, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
	super.addFieldComment(field, introspectedTable, introspectedColumn);
	if (introspectedColumn.getRemarks() != null && !"".equals(introspectedColumn.getRemarks())) {
		field.addJavaDocLine("/**");
		field.addJavaDocLine(" * " + introspectedColumn.getRemarks());
		addJavadocTag(field, false);
		field.addJavaDocLine(" */");
	}
}
 
开发者ID:ChangyiHuang,项目名称:shuzheng,代码行数:11,代码来源:CommentGenerator.java

示例11: addFieldComment

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
@Override
public void addFieldComment(Field field,
        IntrospectedTable introspectedTable,
        IntrospectedColumn introspectedColumn) {
    if (suppressAllComments) {
        return;
    }

    field.addJavaDocLine("/**"); //$NON-NLS-1$

    String remarks = introspectedColumn.getRemarks();
    if (addRemarkComments && StringUtility.stringHasValue(remarks)) {
        field.addJavaDocLine(" * Database Column Remarks:");
        String[] remarkLines = remarks.split(System.getProperty("line.separator"));  //$NON-NLS-1$
        for (String remarkLine : remarkLines) {
            field.addJavaDocLine(" *   " + remarkLine);  //$NON-NLS-1$
        }
    }

    field.addJavaDocLine(" *"); //$NON-NLS-1$
    field
            .addJavaDocLine(" * This field was generated by MyBatis Generator."); //$NON-NLS-1$

    StringBuilder sb = new StringBuilder();
    sb.append(" * This field corresponds to the database column "); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable());
    sb.append('.');
    sb.append(introspectedColumn.getActualColumnName());
    field.addJavaDocLine(sb.toString());

    addJavadocTag(field, false);

    field.addJavaDocLine(" */"); //$NON-NLS-1$
}
 
开发者ID:nextyu,项目名称:summer-mybatis-generator,代码行数:35,代码来源:DefaultCommentGenerator.java


注:本文中的org.mybatis.generator.api.IntrospectedColumn.getRemarks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。