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


Java DatabaseIntrospector类代码示例

本文整理汇总了Java中org.mybatis.generator.internal.db.DatabaseIntrospector的典型用法代码示例。如果您正苦于以下问题:Java DatabaseIntrospector类的具体用法?Java DatabaseIntrospector怎么用?Java DatabaseIntrospector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DatabaseIntrospector类属于org.mybatis.generator.internal.db包,在下文中一共展示了DatabaseIntrospector类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIntrospectedTables

import org.mybatis.generator.internal.db.DatabaseIntrospector; //导入依赖的package包/类
private IntrospectedTable getIntrospectedTables(Context context) {
    IntrospectedTable table = null;
    JavaTypeResolver javaTypeResolver = ObjectFactory.createJavaTypeResolver(context);
    Connection connection = null;
    try {
        connection = getConnection(context.getJdbcConnectionConfiguration());
        DatabaseIntrospector databaseIntrospector =
                new DatabaseIntrospector(context, connection.getMetaData(), javaTypeResolver);
        table = databaseIntrospector.introspectTables(context.getTabconfig());
    } catch (SQLException e) {
        e.printStackTrace();
    } finally {
        closeConnection(connection);
    }
    return table;
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:17,代码来源:CodeServiceImpl.java

示例2: introspectTables

import org.mybatis.generator.internal.db.DatabaseIntrospector; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the
 * constructor. This method is long running.
 * 
 * @param callback
 *            a progress callback if progress information is desired, or
 *            <code>null</code>
 * @param warnings
 *            any warning generated from this method will be added to the
 *            List. Warnings are always Strings.
 * @param fullyQualifiedTableNames
 *            a set of table names to generate. The elements of the set must
 *            be Strings that exactly match what's specified in the
 *            configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If
 *            the Set is null or empty, then all tables in the configuration
 *            will be used for code generation.
 * 
 * @throws SQLException
 *             if some error arises while introspecting the specified
 *             database tables.
 * @throws InterruptedException
 *             if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback,
        List<String> warnings, Set<String> fullyQualifiedTableNames)
        throws SQLException, InterruptedException {

    introspectedTables = new ArrayList<IntrospectedTable>();
    JavaTypeResolver javaTypeResolver = ObjectFactory
            .createJavaTypeResolver(this, warnings);

    Connection connection = null;

    try {
        callback.startTask(getString("Progress.0")); //$NON-NLS-1$
        connection = getConnection();

        DatabaseIntrospector databaseIntrospector = new DatabaseIntrospector(
                this, connection.getMetaData(), javaTypeResolver, warnings);

        for (TableConfiguration tc : tableConfigurations) {
            String tableName = composeFullyQualifiedTableName(tc.getCatalog(), tc
                            .getSchema(), tc.getTableName(), '.');

            if (fullyQualifiedTableNames != null
                    && fullyQualifiedTableNames.size() > 0
                    && !fullyQualifiedTableNames.contains(tableName)) {
                continue;
            }

            if (!tc.areAnyStatementsEnabled()) {
                warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
                continue;
            }

            callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
            List<IntrospectedTable> tables = databaseIntrospector
                    .introspectTables(tc);

            if (tables != null) {
                introspectedTables.addAll(tables);
            }

            callback.checkCancel();
        }
    } finally {
        closeConnection(connection);
    }
}
 
开发者ID:bandaotixi,项目名称:generator_mybatis,代码行数:71,代码来源:Context.java

示例3: introspectTables

import org.mybatis.generator.internal.db.DatabaseIntrospector; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the
 * constructor. This method is long running.
 * 
 * @param callback
 *            a progress callback if progress information is desired, or
 *            <code>null</code>
 * @param warnings
 *            any warning generated from this method will be added to the
 *            List. Warnings are always Strings.
 * @param fullyQualifiedTableNames
 *            a set of table names to generate. The elements of the set must
 *            be Strings that exactly match what's specified in the
 *            configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If
 *            the Set is null or empty, then all tables in the configuration
 *            will be used for code generation.
 * 
 * @throws SQLException
 *             if some error arises while introspecting the specified
 *             database tables.
 * @throws InterruptedException
 *             if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback,
        List<String> warnings, Set<String> fullyQualifiedTableNames)
        throws SQLException, InterruptedException {

    introspectedTables = new ArrayList<IntrospectedTable>();
    JavaTypeResolver javaTypeResolver = ObjectFactory
            .createJavaTypeResolver(this, warnings);

    Connection connection = null;

    try {
        callback.startTask(getString("Progress.0")); //$NON-NLS-1$
        connection = getConnection();

        DatabaseIntrospector databaseIntrospector = new DatabaseIntrospector(
                this, connection.getMetaData(), javaTypeResolver, warnings);

        for (TableConfiguration tc : tableConfigurations) {
            String tableName = composeFullyQualifiedTableName(tc.getCatalog(), tc
                            .getSchema(), tc.getTableName(), '.');

            if (fullyQualifiedTableNames != null
                    && fullyQualifiedTableNames.size() > 0) {
                if (!fullyQualifiedTableNames.contains(tableName)) {
                    continue;
                }
            }

            if (!tc.areAnyStatementsEnabled()) {
                warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
                continue;
            }

            callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
            List<IntrospectedTable> tables = databaseIntrospector
                    .introspectTables(tc);

            if (tables != null) {
                introspectedTables.addAll(tables);
            }

            callback.checkCancel();
        }
    } finally {
        closeConnection(connection);
    }
}
 
开发者ID:backkoms,项目名称:mybatis-generator-comments,代码行数:72,代码来源:Context.java

示例4: introspectTables

import org.mybatis.generator.internal.db.DatabaseIntrospector; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the constructor. This method is long running.
 * 
 * @param callback a progress callback if progress information is desired, or <code>null</code>
 * @param warnings any warning generated from this method will be added to the List. Warnings are always Strings.
 * @param fullyQualifiedTableNames a set of table names to generate. The elements of the set must be Strings that
 *            exactly match what's specified in the configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If the Set is null or empty, then all tables
 *            in the configuration will be used for code generation.
 * 
 * @throws SQLException if some error arises while introspecting the specified database tables.
 * @throws InterruptedException if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames)
        throws SQLException, InterruptedException {

    introspectedTables = new ArrayList<IntrospectedTable>();
    JavaTypeResolver javaTypeResolver = ObjectFactory.createJavaTypeResolver(this);

    Connection connection = null;

    try {
        callback.startTask(getString("Progress.0")); //$NON-NLS-1$
        connection = getConnection();

        DatabaseIntrospector databaseIntrospector =
                new DatabaseIntrospector(this, connection.getMetaData(), javaTypeResolver);

        for (TableConfiguration tc : tableConfigurations) {
            String tableName =
                    composeFullyQualifiedTableName(tc.getCatalog(), tc.getSchema(), tc.getTableName(), '.');

            if (fullyQualifiedTableNames != null && fullyQualifiedTableNames.size() > 0) {
                if (!fullyQualifiedTableNames.contains(tableName)) {
                    continue;
                }
            }

            if (!tc.areAnyStatementsEnabled()) {
                warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
                continue;
            }

            callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
            IntrospectedTable tables = databaseIntrospector.introspectTables(tc);

            if (tables != null) {
                introspectedTables.add(tables);
            }

            callback.checkCancel();
        }
    } finally {
        closeConnection(connection);
    }
}
 
开发者ID:funny5258,项目名称:autocode,代码行数:57,代码来源:Context.java

示例5: introspectTables

import org.mybatis.generator.internal.db.DatabaseIntrospector; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the
 * constructor. This method is long running.
 * 
 * @param callback
 *            a progress callback if progress information is desired, or
 *            <code>null</code>
 * @param warnings
 *            any warning generated from this method will be added to the
 *            List. Warnings are always Strings.
 * @param fullyQualifiedTableNames
 *            a set of table names to generate. The elements of the set must
 *            be Strings that exactly match what's specified in the
 *            configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If
 *            the Set is null or empty, then all tables in the configuration
 *            will be used for code generation.
 * 
 * @throws SQLException
 *             if some error arises while introspecting the specified
 *             database tables.
 * @throws InterruptedException
 *             if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames) throws SQLException, InterruptedException {

	introspectedTables = new ArrayList<IntrospectedTable>();
	JavaTypeResolver javaTypeResolver = ObjectFactory.createJavaTypeResolver(this, warnings);

	Connection connection = null;

	try {
		callback.startTask(getString("Progress.0")); //$NON-NLS-1$
		connection = getConnection();

		DatabaseIntrospector databaseIntrospector = new DatabaseIntrospector(this, connection.getMetaData(), javaTypeResolver, warnings);

		for (TableConfiguration tc : tableConfigurations) {
			String tableName = composeFullyQualifiedTableName(tc.getCatalog(), tc.getSchema(), tc.getTableName(), '.');

			if (fullyQualifiedTableNames != null && fullyQualifiedTableNames.size() > 0) {
				if (!fullyQualifiedTableNames.contains(tableName)) {
					continue;
				}
			}

			if (!tc.areAnyStatementsEnabled()) {
				warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
				continue;
			}

			callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
			List<IntrospectedTable> tables = databaseIntrospector.introspectTables(tc);

			if (tables != null) {
				introspectedTables.addAll(tables);
			}

			callback.checkCancel();
		}
	}
	finally {
		closeConnection(connection);
	}
}
 
开发者ID:handosme,项目名称:mybatis-generator-plus,代码行数:66,代码来源:Context.java

示例6: introspectTables

import org.mybatis.generator.internal.db.DatabaseIntrospector; //导入依赖的package包/类
/**
 * Introspect tables based on the configuration specified in the
 * constructor. This method is long running.
 * 
 * @param callback
 *            a progress callback if progress information is desired, or
 *            <code>null</code>
 * @param warnings
 *            any warning generated from this method will be added to the
 *            List. Warnings are always Strings.
 * @param fullyQualifiedTableNames
 *            a set of table names to generate. The elements of the set must
 *            be Strings that exactly match what's specified in the
 *            configuration. For example, if table name = "foo" and schema =
 *            "bar", then the fully qualified table name is "foo.bar". If
 *            the Set is null or empty, then all tables in the configuration
 *            will be used for code generation.
 * 
 * @throws SQLException
 *             if some error arises while introspecting the specified
 *             database tables.
 * @throws InterruptedException
 *             if the progress callback reports a cancel
 */
public void introspectTables(ProgressCallback callback, List<String> warnings, Set<String> fullyQualifiedTableNames)
		throws SQLException, InterruptedException {

	introspectedTables = new ArrayList<IntrospectedTable>();
	JavaTypeResolver javaTypeResolver = ObjectFactory.createJavaTypeResolver(this, warnings);

	Connection connection = null;

	try {
		callback.startTask(getString("Progress.0")); //$NON-NLS-1$
		connection = getConnection();

		DatabaseIntrospector databaseIntrospector = new DatabaseIntrospector(this, connection.getMetaData(),
				javaTypeResolver, warnings);

		for (TableConfiguration tc : tableConfigurations) {
			String tableName = composeFullyQualifiedTableName(tc.getCatalog(), tc.getSchema(), tc.getTableName(),
					'.');

			if (fullyQualifiedTableNames != null && fullyQualifiedTableNames.size() > 0) {
				if (!fullyQualifiedTableNames.contains(tableName)) {
					continue;
				}
			}

			if (!tc.areAnyStatementsEnabled()) {
				warnings.add(getString("Warning.0", tableName)); //$NON-NLS-1$
				continue;
			}

			callback.startTask(getString("Progress.1", tableName)); //$NON-NLS-1$
			List<IntrospectedTable> tables = databaseIntrospector.introspectTables(tc);

			if (tables != null) {
				introspectedTables.addAll(tables);
			}

			callback.checkCancel();
		}
	} finally {
		closeConnection(connection);
	}
}
 
开发者ID:fnyexx,项目名称:mybator,代码行数:68,代码来源:Context.java


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