本文整理汇总了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();
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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());
}
}