本文整理汇总了Java中org.mybatis.generator.config.TableConfiguration.getAlias方法的典型用法代码示例。如果您正苦于以下问题:Java TableConfiguration.getAlias方法的具体用法?Java TableConfiguration.getAlias怎么用?Java TableConfiguration.getAlias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.mybatis.generator.config.TableConfiguration
的用法示例。
在下文中一共展示了TableConfiguration.getAlias方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateIntrospectedTables
import org.mybatis.generator.config.TableConfiguration; //导入方法依赖的package包/类
private IntrospectedTable calculateIntrospectedTables(TableConfiguration tc,
Map<ActualTableName, List<IntrospectedColumn>> columns) {
boolean delimitIdentifiers =
tc.isDelimitIdentifiers() || stringContainsSpace(tc.getCatalog())
|| stringContainsSpace(tc.getSchema()) || stringContainsSpace(tc.getTableName());
IntrospectedTable introspectedTable = null;
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 = ObjectFactory.createIntrospectedTable(tc, table, context);
for (IntrospectedColumn introspectedColumn : entry.getValue()) {
introspectedTable.addColumn(introspectedColumn);
}
calculatePrimaryKey(table, introspectedTable);
}
return introspectedTable;
}
示例2: calculateIntrospectedTables
import org.mybatis.generator.config.TableConfiguration; //导入方法依赖的package包/类
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;
}
示例3: calculateIntrospectedTables
import org.mybatis.generator.config.TableConfiguration; //导入方法依赖的package包/类
/**
* Calculate introspected tables.
*
* @param tc
* the tc
* @param columns
* the columns
* @return the list
*/
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);
//设置数据库表的备注信息
//start
try{
Statement stmt = this.databaseMetaData.getConnection().createStatement();
ResultSet rs = stmt.executeQuery(new StringBuilder().append("SHOW TABLE STATUS LIKE '").append(atn.getTableName()).append("'").toString());
while (rs.next())//将数据库表得备注信息设置到remark字段
table.setRemark(rs.getString("COMMENT"));
closeResultSet(rs);
stmt.close();
}catch(Exception e){
e.printStackTrace();
}
//end
IntrospectedTable introspectedTable = ObjectFactory
.createIntrospectedTable(tc, table, context);
//TODO 自定义属性
introspectedTable.setOneToOnes(tc.getOneToOnes());
introspectedTable.setOneToManys(tc.getOneToManys());
for (IntrospectedColumn introspectedColumn : entry.getValue()) {
introspectedTable.addColumn(introspectedColumn);
}
calculatePrimaryKey(table, introspectedTable);
enhanceIntrospectedTable(introspectedTable);
answer.add(introspectedTable);
}
return answer;
}
示例4: calculateIntrospectedTables
import org.mybatis.generator.config.TableConfiguration; //导入方法依赖的package包/类
/**
* Calculate introspected tables.
*
* @param tc
* the tc
* @param columns
* the columns
* @return the list
*/
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);
enhanceIntrospectedTable(introspectedTable);
answer.add(introspectedTable);
}
return answer;
}
示例5: calculateIntrospectedTables
import org.mybatis.generator.config.TableConfiguration; //导入方法依赖的package包/类
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;
}