本文整理汇总了Java中org.mybatis.generator.api.CommentGenerator.addFieldComment方法的典型用法代码示例。如果您正苦于以下问题:Java CommentGenerator.addFieldComment方法的具体用法?Java CommentGenerator.addFieldComment怎么用?Java CommentGenerator.addFieldComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mybatis.generator.api.CommentGenerator
的用法示例。
在下文中一共展示了CommentGenerator.addFieldComment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldClones
import org.mybatis.generator.api.CommentGenerator; //导入方法依赖的package包/类
/**
* Gets the field clones.
*
* @param commentGenerator
* the comment generator
* @param introspectedTable
* the introspected table
* @return the field clones
*/
public final List<Field> getFieldClones(CommentGenerator commentGenerator,
IntrospectedTable introspectedTable) {
configure();
List<Field> answer = new ArrayList<Field>();
for (Field oldField : fields) {
Field field = new Field();
field.setInitializationString(oldField.getInitializationString());
field.setFinal(oldField.isFinal());
field.setStatic(oldField.isStatic());
field.setName(oldField.getName());
field.setType(oldField.getType());
field.setVisibility(oldField.getVisibility());
commentGenerator.addFieldComment(field, introspectedTable);
answer.add(field);
}
return answer;
}
示例2: addSerialVersionUID
import org.mybatis.generator.api.CommentGenerator; //导入方法依赖的package包/类
private void addSerialVersionUID(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
CommentGenerator commentGenerator = context.getCommentGenerator();
Field field = new Field();
field.setVisibility(JavaVisibility.PRIVATE);
field.setType(new FullyQualifiedJavaType("Long"));
field.setStatic(true);
field.setFinal(true);
field.setName("serialVersionUID");
field.setInitializationString("1L");
commentGenerator.addFieldComment(field, introspectedTable);
topLevelClass.addField(field);
}