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

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


        // check
        assertSame("Unable to set catalog", catalog, bean.getCatalog());
    }

    public void testSetSchema() {
        Schema schema = new DefaultModelFactory().createSchema();
        // set
        bean.setSchema(schema);
        // check
        assertSame("Unable to set schema", schema, bean.getSchema());
    }
View Full Code Here


        // check
        assertSame("Unable to set type catalog", typeCatalog, bean.getTypeCatalog());
    }

    public void testSetTypeSchema() {
        Schema typeSchema = factory.createSchema();
        // set
        bean.setTypeSchema(typeSchema);
        // check
        assertSame("Unable to set type schema", typeSchema, bean.getTypeSchema());
    }
View Full Code Here

    }

    public void testAddSchema() {
        String NAME = "My Name";
        // create
        Schema object = new DefaultModelFactory().createSchema();
        // set
        object.setName(NAME);
        // add
        bean.addSchema(object);
        // check
        assertFalse(bean.getSchemas().isEmpty());
    }
View Full Code Here

    }

    public void testDeleteSchema() {
        String NAME = "My Name";
        // create
        Schema object = new DefaultModelFactory().createSchema();
        // set
        object.setName(NAME);
        // add
        bean.addSchema(object);
        // check
        assertFalse(bean.getSchemas().isEmpty());
View Full Code Here

    }

    public void testFindSchemaByName() {
        String NAME = "My Name";
        // create
        Schema object = new DefaultModelFactory().createSchema();
        // set
        object.setName(NAME);
        // add
        bean.addSchema(object);
        // check
        assertSame(object, bean.findSchemaByName(null, object.getName()));
    }
View Full Code Here

        // get catalog name
        String catalogName = getString(resultSet, "TABLE_CATALOG", false);

        // create schema object
        Schema schema = factory.createSchema();

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

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

        // ***************
        // *** 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 schema
        if ((procedureSchema != null) && (procedureSchema.trim().length() != 0)) {
            // find schema
            Schema schema = database.findSchemaByName(procedureCatalog, procedureSchema);
            // set schema
            sp.setSchema(schema);
            // warn if null
            if (schema == null) {
                traceLog.debug(String.format("[Database %s] Unable to find schema '%3$s' for the procedure %s (schema %s, catalog %s)",
View Full Code Here

        }

        // 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)",
                                             database.getName(),
                                             tableName,
                                             tableSchema,
                                             typeCatalogName));
            }
        }

        // set schema
        if ((typeSchemaName != null) && (typeSchemaName.trim().length() != 0)) {
            // find schema
            Schema typeSchema = database.findSchemaByName(typeCatalogName, typeSchemaName);
            // set schema
            table.setTypeSchema(typeSchema);
            // warn if null
            if (typeSchema == null) {
                traceLog.debug(String.format("[Database %s] Unable to find schema '%3$s' for the table %s (schema %s, catalog %s)",
View Full Code Here

        }

        // set schema
        if ((udtSchema != null) && (udtSchema.trim().length() != 0)) {
            // find schema
            Schema schema = database.findSchemaByName(udtCatalog, udtSchema);
            // set schema
            udt.setSchema(schema);

            String errMessage = null;
            // warn if null
View Full Code Here

TOP

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

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.