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

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


    }

    public void testAddColumn() {
        String COLUMN_NAME = "My column";
        // create column
        PrimaryKeyColumn column = new DefaultModelFactory().createPrimaryKeyColumn();
        // set name
        column.setName(COLUMN_NAME);
        // add column
        bean.addColumn(column);
        // check
        assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
    }
View Full Code Here


    }

    public void testDeleteColumn() {
        String COLUMN_NAME = "My column";
        // create column
        PrimaryKeyColumn column = new DefaultModelFactory().createPrimaryKeyColumn();
        // set name
        column.setName(COLUMN_NAME);
        // add column
        bean.addColumn(column);
        // check
        assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
View Full Code Here

    }

    public void testFindColumnByName() {
        String COLUMN_NAME = "My column";
        // create column
        PrimaryKeyColumn column = new DefaultModelFactory().createPrimaryKeyColumn();
        // set name
        column.setName(COLUMN_NAME);
        // add column
        bean.addColumn(column);

        // check
        assertSame("Unable to find column", column, bean.findColumnByName(COLUMN_NAME));
View Full Code Here

            if (failOnError && (tableColumn == null)) {
                throw new DatabaseMetaDataMethodException(errMessage, "populatePrimaryKey");
            }

            // create PK column
            PrimaryKeyColumn pkColumn = factory.createPrimaryKeyColumn();
            // check if we found the original table column
            if (tableColumn != null) {
                // mark original table column as part of PK
                tableColumn.setPrimaryKeyColumn(Boolean.TRUE);
                // clone properties from original table column to the pkcolumn
                PropertyUtils.copyProperties(pkColumn, tableColumn);
            } else { // recovery if table column is not found but we still want to create pk column
                // set name at least
                pkColumn.setName(columnName);
            }
            // modify ordinal position that correspond to the position in PK
            pkColumn.setOrdinalPosition(ordinalPosition);

            // add PK column to the primary key
            pk.addColumn(pkColumn);
        }
View Full Code Here

TOP

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

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.