Package org.jboss.dna.common.jdbc.model.api

Examples of org.jboss.dna.common.jdbc.model.api.Catalog


        super.tearDown();
    }

    public void testSetCatalog() {
        Catalog catalog = new DefaultModelFactory().createCatalog();
        // set
        bean.setCatalog(catalog);
        // check
        assertSame("Unable to set catalog", catalog, bean.getCatalog());
    }
View Full Code Here


        super.tearDown();
    }

    public void testSetCatalog() {
        Catalog catalog = new DefaultModelFactory().createCatalog();
        // set
        bean.setCatalog(catalog);
        // check
        assertSame("Unable to set catalog", catalog, bean.getCatalog());
    }
View Full Code Here

        // check
        assertSame("Unable to set table type", tableType, bean.getTableType());
    }

    public void testSetTypeCatalog() {
        Catalog typeCatalog = factory.createCatalog();
        // set
        bean.setTypeCatalog(typeCatalog);
        // check
        assertSame("Unable to set type catalog", typeCatalog, bean.getTypeCatalog());
    }
View Full Code Here

    }

    public void testAddCatalog() {
        String NAME = "My Name";
        // create
        Catalog object = new DefaultModelFactory().createCatalog();
        // set
        object.setName(NAME);
        // add
        bean.addCatalog(object);
        // check
        assertFalse(bean.getCatalogs().isEmpty());
    }
View Full Code Here

    }

    public void testDeleteCatalog() {
        String NAME = "My Name";
        // create
        Catalog object = new DefaultModelFactory().createCatalog();
        // set
        object.setName(NAME);
        // add
        bean.addCatalog(object);
        // check
        assertFalse(bean.getCatalogs().isEmpty());
View Full Code Here

    }

    public void testFindCatalogByName() {
        String NAME = "My Name";
        // create
        Catalog object = new DefaultModelFactory().createCatalog();
        // set
        object.setName(NAME);
        // add
        bean.addCatalog(object);
        // check
        assertSame(object, bean.findCatalogByName(object.getName()));
    }
View Full Code Here

        // get type catalog
        String catalogName = getString(resultSet, "TABLE_CAT", false);

        // create catalog object
        Catalog catalog = factory.createCatalog();

        // ***************************
        // *** DatabaseNamedObject ***
        // ***************************

        // set name
        catalog.setName(catalogName);
        // set remarks
        // catalog.setRemarks (remarks); // N/A
        // TODO set extra properties
        // catalog.addExtraProperty (String key, Object value);

View Full Code Here

        // *** Schema ***
        // ***************

        // check catalog name
        if (catalogName != null) {
            Catalog catalog = database.findCatalogByName(catalogName);
            schema.setCatalog(catalog);
        }

        // add schema to the list
        database.addSchema(schema);
View Full Code Here

        // ********************

        // set catalog
        if ((procedureCatalog != null) && (procedureCatalog.trim().length() != 0)) {
            // find catalog
            Catalog catalog = database.findCatalogByName(procedureCatalog);
            // set catalog
            sp.setCatalog(catalog);
            // warn if null
            if (catalog == null) {
                traceLog.debug(String.format("[Database %s] Unable to find catalog '%4$s' for the procedure %s (schema %s, catalog %s)",
View Full Code Here

        // ********************

        // set catalog
        if ((tableCatalog != null) && (tableCatalog.trim().length() != 0)) {
            // find catalog
            Catalog catalog = database.findCatalogByName(tableCatalog);
            // set catalog
            table.setCatalog(catalog);
            // warn if null
            if (catalog == null) {
                traceLog.debug(String.format("[Database %s] Unable to find catalog '%4$s' for the table %s (schema %s, catalog %s)",
                                             database.getName(),
                                             tableName,
                                             tableSchema,
                                             tableCatalog));
            }
            // if fail is enabled
            if (failOnError) {
                throw new DatabaseMetaDataMethodException("Catalog name shall be provided", "populateTable");

            }
        }

        // set schema
        if ((tableSchema != null) && (tableSchema.trim().length() != 0)) {
            // find schema
            Schema schema = database.findSchemaByName(tableCatalog, tableSchema);
            // set schema
            table.setSchema(schema);
            // warn if null
            if (schema == null) {
                traceLog.debug(String.format("[Database %s] Unable to find schema '%3$s' for the table %s (schema %s, catalog %s)",
                                             database.getName(),
                                             tableName,
                                             tableSchema,
                                             tableCatalog));
            }
            // if fail is enabled
            if (failOnError) {
                throw new DatabaseMetaDataMethodException("Table name shall be provided", "populateTable");
            }
        }

        // **************
        // *** Table ***
        // **************

        // set table type
        if (tableTypeName != null) {
            // create
            TableType tableType = factory.createTableType();
            // fill
            tableType.setName(tableTypeName);
            // set type
            table.setTableType(tableType);
        }

        // set catalog
        if ((typeCatalogName != null) && (typeCatalogName.trim().length() != 0)) {
            // find catalog
            Catalog typeCatalog = database.findCatalogByName(typeCatalogName);
            // set type catalog
            table.setTypeCatalog(typeCatalog);
            // warn if null
            if (typeCatalog == null) {
                traceLog.debug(String.format("[Database %s] Unable to find catalog '%4$s' for the table %s (schema %s, catalog %s)",
View Full Code Here

TOP

Related Classes of org.jboss.dna.common.jdbc.model.api.Catalog

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.