org.mybatis.generator.config.TableConfiguration.getAlias()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.mybatis.generator.config.TableConfiguration.getAlias()方法的一些代码示例,展示了TableConfiguration.getAlias()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableConfiguration.getAlias()方法的具体详情如下:
包路径:org.mybatis.generator.config.TableConfiguration
类名称:TableConfiguration
方法名:getAlias

TableConfiguration.getAlias介绍

暂无

代码示例

代码示例来源:origin: dcendents/mybatis-generator-plugins

/**
 * Remove the id columns from the sql statement. Useful when the generated update statement is trying to update an
 * id column.
 *
 * @param introspectedTable
 *            the table
 * @param element
 *            the element
 */
void removeIdColumns(IntrospectedTable introspectedTable, XmlElement element) {
  List<String> updates = new ArrayList<>();
  String alias = introspectedTable.getTableConfiguration().getAlias();
  if (alias == null) {
    alias = "";
  } else {
    alias = alias + ".";
  }
  List<IntrospectedColumn> ids = introspectedTable.getPrimaryKeyColumns();
  for (IntrospectedColumn column : ids) {
    String typeHandler = column.getTypeHandler() != null ? String.format(",typeHandler=%s", column.getTypeHandler()) : "";
    String update = String.format("%4$s%1$s = #{record.%2$s,jdbcType=%3$s%5$s},", column.getActualColumnName(),
        column.getJavaProperty(), column.getJdbcTypeName(), alias, typeHandler);
    log.debug("update: {}", update);
    updates.add(update);
  }
  if (!updates.isEmpty()) {
    removeIdColumns(updates, element, null, -1);
  }
}

代码示例来源:origin: roncoo/roncoo-mybatis-generator

.createIntrospectedColumn(context);
introspectedColumn.setTableAlias(tc.getAlias());
introspectedColumn.setJdbcType(rs.getInt("DATA_TYPE")); //$NON-NLS-1$
introspectedColumn.setLength(rs.getInt("COLUMN_SIZE")); //$NON-NLS-1$

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

.createIntrospectedColumn(context);
introspectedColumn.setTableAlias(tc.getAlias());
introspectedColumn.setJdbcType(rs.getInt("DATA_TYPE")); //$NON-NLS-1$
introspectedColumn.setLength(rs.getInt("COLUMN_SIZE")); //$NON-NLS-1$

代码示例来源:origin: handosme/mybatis-generator-plus

.createIntrospectedColumn(context);
introspectedColumn.setTableAlias(tc.getAlias());
introspectedColumn.setJdbcType(rs.getInt("DATA_TYPE")); //$NON-NLS-1$
introspectedColumn.setLength(rs.getInt("COLUMN_SIZE")); //$NON-NLS-1$

代码示例来源:origin: cxjava/mybatis-generator-core

IntrospectedColumn introspectedColumn = ObjectFactory.createIntrospectedColumn(context);
introspectedColumn.setTableAlias(tc.getAlias());
introspectedColumn.setJdbcType(rs.getInt("DATA_TYPE")); //$NON-NLS-1$
introspectedColumn.setLength(rs.getInt("COLUMN_SIZE")); //$NON-NLS-1$

代码示例来源:origin: cxjava/mybatis-generator-core

private List<IntrospectedTable> calculateIntrospectedTables(TableConfiguration tc,
    Map<ActualTableName, List<IntrospectedColumn>> columns) {
  boolean delimitIdentifiers = tc.isDelimitIdentifiers() || stringContainsSpace(tc.getCatalog())
      || stringContainsSpace(tc.getSchema()) || stringContainsSpace(tc.getTableName());
  List<IntrospectedTable> answer = new ArrayList<IntrospectedTable>();
  for (Map.Entry<ActualTableName, List<IntrospectedColumn>> entry : columns.entrySet()) {
    ActualTableName atn = entry.getKey();
    // we only use the returned catalog and schema if something was
    // actually
    // specified on the table configuration. If something was returned
    // from the DB for these fields, but nothing was specified on the
    // table
    // configuration, then some sort of DB default is being returned
    // and we don't want that in our SQL
    FullyQualifiedTable table = new FullyQualifiedTable(stringHasValue(tc.getCatalog()) ? atn.getCatalog()
        : null, stringHasValue(tc.getSchema()) ? atn.getSchema() : null, atn.getTableName(),
        tc.getDomainObjectName(), tc.getAlias(),
        isTrue(tc.getProperty(PropertyRegistry.TABLE_IGNORE_QUALIFIERS_AT_RUNTIME)),
        tc.getProperty(PropertyRegistry.TABLE_RUNTIME_CATALOG),
        tc.getProperty(PropertyRegistry.TABLE_RUNTIME_SCHEMA),
        tc.getProperty(PropertyRegistry.TABLE_RUNTIME_TABLE_NAME), delimitIdentifiers, context);
    IntrospectedTable introspectedTable = ObjectFactory.createIntrospectedTable(tc, table, context);
    for (IntrospectedColumn introspectedColumn : entry.getValue()) {
      introspectedTable.addColumn(introspectedColumn);
    }
    calculatePrimaryKey(table, introspectedTable);
    answer.add(introspectedTable);
  }
  return answer;
}

代码示例来源:origin: handosme/mybatis-generator-plus

atn.getTableName(),
tc.getDomainObjectName(),
tc.getAlias(),
isTrue(tc.getProperty(PropertyRegistry.TABLE_IGNORE_QUALIFIERS_AT_RUNTIME)),
tc.getProperty(PropertyRegistry.TABLE_RUNTIME_CATALOG),

代码示例来源:origin: roncoo/roncoo-mybatis-generator

atn.getTableName(),
tc.getDomainObjectName(),
tc.getAlias(),
isTrue(tc.getProperty(PropertyRegistry.TABLE_IGNORE_QUALIFIERS_AT_RUNTIME)),
tc.getProperty(PropertyRegistry.TABLE_RUNTIME_CATALOG),

代码示例来源:origin: org.mybatis.generator/mybatis-generator-core

atn.getTableName(),
tc.getDomainObjectName(),
tc.getAlias(),
isTrue(tc.getProperty(PropertyRegistry.TABLE_IGNORE_QUALIFIERS_AT_RUNTIME)),
tc.getProperty(PropertyRegistry.TABLE_RUNTIME_CATALOG),

相关文章

微信公众号

最新文章

更多

TableConfiguration类方法