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


Java IntrospectedColumn.isColumnNameDelimited方法代码示例

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


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

示例1: getAliasedActualColumnName

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * The aliased column name for a select statement generated by the example clauses. This is not appropriate for
 * selects in SqlMaps because the column is not escaped for MyBatis. If there is a table alias, the value will be
 * alias.columnName.
 * 
 * This method is used in the Example classes and the returned value will be in a Java string. So we need to escape
 * double quotes if they are the delimiters.
 *
 * @param introspectedColumn
 *            the introspected column
 * @return the aliased column name
 */
public static String getAliasedActualColumnName(
        IntrospectedColumn introspectedColumn) {
    StringBuilder sb = new StringBuilder();
    if (stringHasValue(introspectedColumn.getTableAlias())) {
        sb.append(introspectedColumn.getTableAlias());
        sb.append('.');
    }

    if (introspectedColumn.isColumnNameDelimited()) {
        sb.append(escapeStringForJava(introspectedColumn
                .getContext().getBeginningDelimiter()));
    }

    sb.append(introspectedColumn.getActualColumnName());

    if (introspectedColumn.isColumnNameDelimited()) {
        sb.append(escapeStringForJava(introspectedColumn
                .getContext().getEndingDelimiter()));
    }

    return sb.toString();
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:35,代码来源:MyBatis3FormattingUtilities.java

示例2: getAliasedActualColumnName

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * The aliased column name for a select statement generated by the example clauses. This is not appropriate for
 * selects in SqlMaps because the column is not escaped for iBATIS. If there is a table alias, the value will be
 * alias.columnName.
 * 
 * This method is used in the Example classes and the returned value will be in a Java string. So we need to escape
 * double quotes if they are the delimiters.
 *
 * @param introspectedColumn
 *            the introspected column
 * @return the aliased column name
 */
public static String getAliasedActualColumnName(
        IntrospectedColumn introspectedColumn) {
    StringBuilder sb = new StringBuilder();
    if (stringHasValue(introspectedColumn.getTableAlias())) {
        sb.append(introspectedColumn.getTableAlias());
        sb.append('.');
    }

    if (introspectedColumn.isColumnNameDelimited()) {
        sb.append(escapeStringForJava(introspectedColumn
                .getContext().getBeginningDelimiter()));
    }

    sb.append(introspectedColumn.getActualColumnName());

    if (introspectedColumn.isColumnNameDelimited()) {
        sb.append(escapeStringForJava(introspectedColumn
                .getContext().getEndingDelimiter()));
    }

    return sb.toString();
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:35,代码来源:Ibatis2FormattingUtilities.java

示例3: getSelectListPhrase

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * The phrase to use in a select list. If there is a table alias, the value will be
 * "alias.columnName as alias_columnName"
 *
 * @param introspectedColumn
 *            the introspected column
 * @return the proper phrase
 */
public static String getSelectListPhrase(
        IntrospectedColumn introspectedColumn) {
    if (stringHasValue(introspectedColumn.getTableAlias())) {
        StringBuilder sb = new StringBuilder();

        sb.append(getAliasedEscapedColumnName(introspectedColumn));
        sb.append(" as "); //$NON-NLS-1$
        if (introspectedColumn.isColumnNameDelimited()) {
            sb.append(introspectedColumn.getContext()
                    .getBeginningDelimiter());
        }
        sb.append(introspectedColumn.getTableAlias());
        sb.append('_');
        sb.append(escapeStringForIbatis2(introspectedColumn
                .getActualColumnName()));
        if (introspectedColumn.isColumnNameDelimited()) {
            sb.append(introspectedColumn.getContext().getEndingDelimiter());
        }
        return sb.toString();
    } else {
        return getEscapedColumnName(introspectedColumn);
    }
}
 
开发者ID:DomKing,项目名称:springbootWeb,代码行数:32,代码来源:Ibatis2FormattingUtilities.java

示例4: getSelectListPhrase

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * The phrase to use in a select list. If there is a table alias, the value will be
 * "alias.columnName as alias_columnName"
 *
 * @param introspectedColumn
 *            the introspected column
 * @return the proper phrase
 */
public static String getSelectListPhrase(
        IntrospectedColumn introspectedColumn) {
    if (stringHasValue(introspectedColumn.getTableAlias())) {
        StringBuilder sb = new StringBuilder();

        sb.append(getAliasedEscapedColumnName(introspectedColumn));
        sb.append(" as "); //$NON-NLS-1$
        if (introspectedColumn.isColumnNameDelimited()) {
            sb.append(introspectedColumn.getContext()
                    .getBeginningDelimiter());
        }
        sb.append(introspectedColumn.getTableAlias());
        sb.append('_');
        sb.append(escapeStringForMyBatis3(introspectedColumn
                .getActualColumnName()));
        if (introspectedColumn.isColumnNameDelimited()) {
            sb.append(introspectedColumn.getContext().getEndingDelimiter());
        }
        return sb.toString();
    } else {
        return getEscapedColumnName(introspectedColumn);
    }
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:32,代码来源:MyBatis3FormattingUtilities.java

示例5: getEscapedColumnName

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * Gets the escaped column name.
 *
 * @param introspectedColumn
 *            the introspected column
 * @return the escaped column name
 */
public static String getEscapedColumnName(
        IntrospectedColumn introspectedColumn) {
    StringBuilder sb = new StringBuilder();
    sb.append(escapeStringForMyBatis3(introspectedColumn
            .getActualColumnName()));

    if (introspectedColumn.isColumnNameDelimited()) {
        sb.insert(0, introspectedColumn.getContext()
                .getBeginningDelimiter());
        sb.append(introspectedColumn.getContext().getEndingDelimiter());
    }

    return sb.toString();
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:22,代码来源:MyBatis3FormattingUtilities.java

示例6: getEscapedColumnName

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * Gets the escaped column name.
 *
 * @param introspectedColumn
 *            the introspected column
 * @return the escaped column name
 */
public static String getEscapedColumnName(
        IntrospectedColumn introspectedColumn) {
    StringBuilder sb = new StringBuilder();
    sb.append(escapeStringForIbatis2(introspectedColumn
            .getActualColumnName()));

    if (introspectedColumn.isColumnNameDelimited()) {
        sb.insert(0, introspectedColumn.getContext()
                .getBeginningDelimiter());
        sb.append(introspectedColumn.getContext().getEndingDelimiter());
    }

    return sb.toString();
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:22,代码来源:Ibatis2FormattingUtilities.java

示例7: isMatchedColumn

import org.mybatis.generator.api.IntrospectedColumn; //导入方法依赖的package包/类
/**
 * Checks if is matched column.
 *
 * @param introspectedColumn
 *            the introspected column
 * @param gk
 *            the gk
 * @return true, if is matched column
 */
private boolean isMatchedColumn(IntrospectedColumn introspectedColumn, GeneratedKey gk) {
    if (introspectedColumn.isColumnNameDelimited()) {
        return introspectedColumn.getActualColumnName().equals(gk.getColumn());
    } else {
        return introspectedColumn.getActualColumnName().equalsIgnoreCase(gk.getColumn());
    }
}
 
开发者ID:DomKing,项目名称:server-utility,代码行数:17,代码来源:DatabaseIntrospector.java


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