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


Java IntrospectedTable类代码示例

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


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

示例1: addClassComment

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
@Override
public void addClassComment(InnerClass innerClass,
        IntrospectedTable introspectedTable, boolean markAsDoNotDelete) {
    if (suppressAllComments) {
        return;
    }

    StringBuilder sb = new StringBuilder();

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

    sb.append(" * This class corresponds to the database table "); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable());
    innerClass.addJavaDocLine(sb.toString());

    addJavadocTag(innerClass, markAsDoNotDelete);

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

示例2: getUpdateByPrimaryKeyWithoutBLOBsMethodName

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
/**
 * 1. if this will be the only updateByPrimaryKey, then the result should be
 * updateByPrimaryKey. 2. If the other method is enabled, but there are
 * seperate base and blob classes, then the method name should be
 * updateByPrimaryKey 3. Else the method name should be
 * updateByPrimaryKeyWithoutBLOBs
 */
public String getUpdateByPrimaryKeyWithoutBLOBsMethodName(
        IntrospectedTable introspectedTable) {
    StringBuilder sb = new StringBuilder();

    sb.append("update"); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable()
            .getDomainObjectName());

    Rules rules = introspectedTable.getRules();

    if (!rules.generateUpdateByPrimaryKeyWithBLOBs()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else if (rules.generateRecordWithBLOBsClass()) {
        sb.append("ByPrimaryKey"); //$NON-NLS-1$
    } else {
        sb.append("ByPrimaryKeyWithoutBLOBs"); //$NON-NLS-1$
    }

    return sb.toString();
}
 
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:28,代码来源:ExtendedDAOMethodNameCalculator.java

示例3: sqlMapSelectByExampleWithoutBLOBsElementGenerated

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
/**
 * 为Mapper.xml的selectByExample添加limit,offset
 */
@Override
public boolean sqlMapSelectByExampleWithoutBLOBsElementGenerated(XmlElement element,
                                                                 IntrospectedTable introspectedTable) {

	XmlElement ifLimitNotNullElement = new XmlElement("if");
	ifLimitNotNullElement.addAttribute(new Attribute("test", "limit != null"));

	XmlElement ifOffsetNotNullElement = new XmlElement("if");
	ifOffsetNotNullElement.addAttribute(new Attribute("test", "offset != null"));
	ifOffsetNotNullElement.addElement(new TextElement("limit ${offset}, ${limit}"));
	ifLimitNotNullElement.addElement(ifOffsetNotNullElement);

	XmlElement ifOffsetNullElement = new XmlElement("if");
	ifOffsetNullElement.addAttribute(new Attribute("test", "offset == null"));
	ifOffsetNullElement.addElement(new TextElement("limit ${limit}"));
	ifLimitNotNullElement.addElement(ifOffsetNullElement);

	element.addElement(ifLimitNotNullElement);

	return true;
}
 
开发者ID:ChangyiHuang,项目名称:shuzheng,代码行数:25,代码来源:PaginationPlugin.java

示例4: addFieldComment

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

    StringBuilder sb = new StringBuilder();

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

    //   sb.append(" * This field corresponds to the database table "); //$NON-NLS-1$
    sb.append(introspectedTable.getFullyQualifiedTable());
    field.addJavaDocLine(sb.toString());

    addJavadocTag(field, false);

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

示例5: makeSerializable

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
protected void makeSerializable(TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
    if(this.addGWTInterface) {
        topLevelClass.addImportedType(this.gwtSerializable);
        topLevelClass.addSuperInterface(this.gwtSerializable);
    }

    if(!this.suppressJavaInterface) {
        topLevelClass.addImportedType(this.serializable);
        topLevelClass.addSuperInterface(this.serializable);
        Field field = new Field();
        field.setFinal(true);
        field.setInitializationString("1L");
        field.setName("serialVersionUID");
        field.setStatic(true);
        field.setType(new FullyQualifiedJavaType("long"));
        field.setVisibility(JavaVisibility.PRIVATE);
        this.context.getCommentGenerator().addFieldComment(field, introspectedTable);
        topLevelClass.addField(field);
    }

}
 
开发者ID:ywtnhm,项目名称:pay-xxpay-master,代码行数:22,代码来源:SerializablePlugin.java

示例6: makeSerializable

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
protected void makeSerializable(TopLevelClass topLevelClass,
        IntrospectedTable introspectedTable) {
    if (addGWTInterface) {
        topLevelClass.addImportedType(gwtSerializable);
        topLevelClass.addSuperInterface(gwtSerializable);
    }
    
    if (!suppressJavaInterface) {
        topLevelClass.addImportedType(serializable);
        topLevelClass.addSuperInterface(serializable);

        Field field = new Field();
        field.setFinal(true);
        field.setInitializationString("1L"); //$NON-NLS-1$
        field.setName("serialVersionUID"); //$NON-NLS-1$
        field.setStatic(true);
        field.setType(new FullyQualifiedJavaType("long")); //$NON-NLS-1$
        field.setVisibility(JavaVisibility.PRIVATE);
        context.getCommentGenerator().addFieldComment(field, introspectedTable);

        topLevelClass.addField(field);
    }
}
 
开发者ID:xiachengwei5,项目名称:org.mybatis.generator.core-1.3.5,代码行数:24,代码来源:SerializablePlugin.java

示例7: getConstructorClone

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
/**
 * Gets the constructor clone.
 *
 * @param commentGenerator
 *            the comment generator
 * @param type
 *            the type
 * @param introspectedTable
 *            the introspected table
 * @return the constructor clone
 */
public final Method getConstructorClone(CommentGenerator commentGenerator,
        FullyQualifiedJavaType type, IntrospectedTable introspectedTable) {
    configure();
    Method answer = new Method();
    answer.setConstructor(true);
    answer.setName(type.getShortName());
    answer.setVisibility(constructorTemplate.getVisibility());
    for (Parameter parm : constructorTemplate.getParameters()) {
        answer.addParameter(parm);
    }

    for (String bodyLine : constructorTemplate.getBodyLines()) {
        answer.addBodyLine(bodyLine);
    }

    for (FullyQualifiedJavaType fqjt : constructorTemplate.getExceptions()) {
        answer.addException(fqjt);
    }

    commentGenerator.addGeneralMethodComment(answer, introspectedTable);

    return answer;
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:35,代码来源:AbstractDAOTemplate.java

示例8: addSetterComment

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
public void addSetterComment(Method method, IntrospectedTable introspectedTable, IntrospectedColumn introspectedColumn) {
    StringBuilder sb = new StringBuilder();
    method.addJavaDocLine("/**");
    if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
        sb.append(" * 设置");
        sb.append(introspectedColumn.getRemarks());
        method.addJavaDocLine(sb.toString());
        method.addJavaDocLine(" *");
    }

    Parameter param = (Parameter)method.getParameters().get(0);
    sb.setLength(0);
    sb.append(" * @param ");
    sb.append(param.getName());
    if (StringUtility.stringHasValue(introspectedColumn.getRemarks())) {
        sb.append(" ");
        sb.append(introspectedColumn.getRemarks());
    }

    method.addJavaDocLine(sb.toString());
    method.addJavaDocLine(" */");
}
 
开发者ID:ling49043171,项目名称:mark-mybatis-generator,代码行数:23,代码来源:MyCommentGenerator.java

示例9: providerDeleteByExampleMethodGenerated

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
public boolean providerDeleteByExampleMethodGenerated(Method method,
        TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
    boolean rc = true;

    for (Plugin plugin : plugins) {
        if (!plugin.providerDeleteByExampleMethodGenerated(method,
                topLevelClass, introspectedTable)) {
            rc = false;
            break;
        }
    }

    return rc;
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:15,代码来源:PluginAggregator.java

示例10: modelRecordWithBLOBsClassGenerated

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
public boolean modelRecordWithBLOBsClassGenerated(TopLevelClass tlc,
        IntrospectedTable introspectedTable) {
    boolean rc = true;

    for (Plugin plugin : plugins) {
        if (!plugin.modelRecordWithBLOBsClassGenerated(tlc,
                introspectedTable)) {
            rc = false;
            break;
        }
    }

    return rc;
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:15,代码来源:PluginAggregator.java

示例11: modelPrimaryKeyClassGenerated

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
@Override
public boolean modelPrimaryKeyClassGenerated(TopLevelClass topLevelClass,
        IntrospectedTable introspectedTable) {
    generateEquals(topLevelClass, introspectedTable.getPrimaryKeyColumns(),
            introspectedTable);
    generateHashCode(topLevelClass, introspectedTable
            .getPrimaryKeyColumns(), introspectedTable);

    return true;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:11,代码来源:EqualsHashCodePlugin.java

示例12: addGeneralMethodComment

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
public void addGeneralMethodComment(Method method, IntrospectedTable introspectedTable) {
    if (suppressAllComments) {
        return;
    }
  method.addJavaDocLine("/**");
  addJavadocTag(method, false);
  method.addJavaDocLine(" */");
}
 
开发者ID:xiachuanshou,项目名称:shop-manager,代码行数:9,代码来源:MyCommentGenerator.java

示例13: sqlMapInsertElementGenerated

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
public boolean sqlMapInsertElementGenerated(XmlElement element,
        IntrospectedTable introspectedTable) {
    boolean rc = true;

    for (Plugin plugin : plugins) {
        if (!plugin
                .sqlMapInsertElementGenerated(element, introspectedTable)) {
            rc = false;
            break;
        }
    }

    return rc;
}
 
开发者ID:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:15,代码来源:PluginAggregator.java

示例14: reportIntrospectionWarnings

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
/**
 * Report introspection warnings.
 *
 * @param introspectedTable
 *            the introspected table
 * @param tableConfiguration
 *            the table configuration
 * @param table
 *            the table
 */
private void reportIntrospectionWarnings(
        IntrospectedTable introspectedTable,
        TableConfiguration tableConfiguration, FullyQualifiedTable table) {
    // make sure that every column listed in column overrides
    // actually exists in the table
    for (ColumnOverride columnOverride : tableConfiguration
            .getColumnOverrides()) {
        if (introspectedTable.getColumn(columnOverride.getColumnName()) == null) {
            warnings.add(getString("Warning.3", //$NON-NLS-1$
                    columnOverride.getColumnName(), table.toString()));
        }
    }

    // make sure that every column listed in ignored columns
    // actually exists in the table
    for (String string : tableConfiguration.getIgnoredColumnsInError()) {
        warnings.add(getString("Warning.4", //$NON-NLS-1$
                string, table.toString()));
    }

    GeneratedKey generatedKey = tableConfiguration.getGeneratedKey();
    if (generatedKey != null
            && introspectedTable.getColumn(generatedKey.getColumn()) == null) {
        if (generatedKey.isIdentity()) {
            warnings.add(getString("Warning.5", //$NON-NLS-1$
                    generatedKey.getColumn(), table.toString()));
        } else {
            warnings.add(getString("Warning.6", //$NON-NLS-1$
                    generatedKey.getColumn(), table.toString()));
        }
    }
    
    for (IntrospectedColumn ic : introspectedTable.getAllColumns()) {
        if (JavaReservedWords.containsWord(ic.getJavaProperty())) {
            warnings.add(getString("Warning.26", //$NON-NLS-1$
                    ic.getActualColumnName(), table.toString()));
        }
    }
}
 
开发者ID:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:50,代码来源:DatabaseIntrospector.java

示例15: clientSelectByExampleWithoutBLOBsMethodGenerated

import org.mybatis.generator.api.IntrospectedTable; //导入依赖的package包/类
@Override
public boolean clientSelectByExampleWithoutBLOBsMethodGenerated(
        Method method, Interface interfaze,
        IntrospectedTable introspectedTable) {
    if (introspectedTable.getTargetRuntime() == TargetRuntime.MYBATIS3) {
        copyAndAddMethod(method, interfaze);
    }
    return true;
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:10,代码来源:RowBoundsPlugin.java


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