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


Java TableConfiguration.getAlias方法代码示例

本文整理汇总了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;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:37,代码来源:DatabaseIntrospector.java

示例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;
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:39,代码来源:DatabaseIntrospector.java

示例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;
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:75,代码来源:DatabaseIntrospector.java

示例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;
}
 
开发者ID:Yanweichen,项目名称:MybatisGeneatorUtil,代码行数:61,代码来源:DatabaseIntrospector.java

示例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;
}
 
开发者ID:handosme,项目名称:mybatis-generator-plus,代码行数:50,代码来源:DatabaseIntrospector.java


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