Package com.asakusafw.modelgen.source

Examples of com.asakusafw.modelgen.source.DatabaseSource


    private void collectFromDb(ModelRepository repository) throws IOException, SQLException {
        LOG.info("データベース\"{}\"からテーブルの定義を読み込んでいます",
                configuration.getJdbcUrl());

        DatabaseSource source = new DatabaseSource(
                configuration.getJdbcDriver(),
                configuration.getJdbcUrl(),
                configuration.getJdbcUser(),
                configuration.getJdbcPassword(),
                configuration.getDatabaseName());
        try {
            List<ModelDescription> collected = source.collectTables(
                    configuration.getMatcher());

            for (ModelDescription model : collected) {
                LOG.info("データベースから読み込んだテーブルモデル{}を登録しています",
                        model.getReference());
                repository.add(model);
            }

            LOG.info("データベースから{}個のテーブルモデルを登録しました", collected.size());
        } finally {
            source.close();
        }
    }
View Full Code Here


    private void collectFromViews(ModelRepository repository) throws IOException, SQLException {
        LOG.info("データベース\"{}\"からビューの定義を読み込んでいます",
                configuration.getJdbcUrl());

        DatabaseSource source = new DatabaseSource(
                configuration.getJdbcDriver(),
                configuration.getJdbcUrl(),
                configuration.getJdbcUser(),
                configuration.getJdbcPassword(),
                configuration.getDatabaseName());
        try {
            List<ModelDescription> collected = source.collectViews(
                    repository,
                    configuration.getMatcher());

            for (ModelDescription model : collected) {
                LOG.info("データベースから読み込んだビューモデル{}を登録しています",
                        model.getReference());
                repository.add(model);
            }

            LOG.info("データベースから{}個のビューモデルを登録しました", collected.size());
        } finally {
            source.close();
        }
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.modelgen.source.DatabaseSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.