Package org.jitterbit.integration.database.info

Examples of org.jitterbit.integration.database.info.DatabaseObject


            test.dispose();
        }
    }

    private static void testUsingMetaData(DatabaseColumnRetrieverTest test) throws SQLException {
        DatabaseObject table = new DatabaseTable("sourcestab", null);
        test.listColumns(table);
    }
View Full Code Here


        DatabaseObject table = new DatabaseTable("sourcestab", null);
        test.listColumns(table);
    }

    private static void testManualSqlStatement(DatabaseColumnRetrieverTest test) throws SQLException {
        DatabaseObject table = new ManualSqlStatement("select * from sourcestab where (1=2)");
        test.listColumns(table);
    }
View Full Code Here

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                        boolean hasFocus, int row, int column) {
            super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
            DatabaseObject item = (DatabaseObject) value;
            String text = selectionModel.isSchemaNameIncluded() ? getQualifiedName(item) : item.getName();
            setText(text);
            return this;
        }
View Full Code Here

    }

    private void processTables() {
        translatedObjects = Maps.newLinkedHashMap();
        for (int n = 0; n < tables.length; ++n) {
            DatabaseObject original = tables[n];
            DatabaseObject copy = translate(original, quotes);
            translatedObjects.put(original.getName(), copy);
            tables[n] = copy;
        }
    }
View Full Code Here

    private void processRelationships() {
        DbTranRelations original = dbStruct.getRelations();
        List<Relation> copiedJoins = Lists.newArrayList();
        for (Relation join : original.getRelations()) {
            DatabaseObject parent = translatedObjects.get(join.getParentName());
            DatabaseObject child = translatedObjects.get(join.getChildName());
            if (parent != null && child != null) {
                DatabaseColumn parentField = parent.findColumn(join.getParentField());
                DatabaseColumn childField = child.findColumn(join.getChildField());
                if (parentField != null && childField != null) {
                    TableRelationship tr = new TableRelationship(parent, child);
                    tr.setRelationshipNature(join.getCardinality());
                    FieldRelationship fr = new FieldRelationship(parentField, childField);
                    copiedJoins.add(new Relation(tr, fr));
View Full Code Here

    private void processFilters() {
        DbTranFilters original = dbStruct.getHierarchicalFilters();
        List<Entry> copiedEntries = Lists.newArrayList();
        for (Entry e : original.getAllEntries()) {
            DatabaseObject table = translatedObjects.get(e.getTableName());
            if (table != null) {
                DatabaseColumn column = table.getColumn(e.getColumnName());
                if (column != null) {
                    copiedEntries.add(new Entry(table.getName(), column.getName(), e.getCondition(), e.getSortOrder()));
                }
            }
        }
        DbTranFilters copiedFilters = new DbTranFilters();
        for (Entry e : copiedEntries) {
View Full Code Here

                List<DatabaseColumn> updateKeys = Lists.newArrayList();
                for (String part : e.getKeyFields().split(DbFields.FIELD_SEPARATOR)) {
                    int sep = part.lastIndexOf('.');
                    String tableName = part.substring(0, sep);
                    String columnName = part.substring(sep + 1);
                    DatabaseObject table = translatedObjects.get(tableName);
                    if (table != null) {
                        DatabaseColumn column = table.findColumn(columnName);
                        if (column != null) {
                            updateKeys.add(column);
                        }
                    }
                }
View Full Code Here

    }

    @Override
    protected DatabaseObject translate(DatabaseObject original, BeginEndQuote quotes) {
        String qualName = quotes.getQualifiedName(original);
        DatabaseObject copy = original.createCopy(qualName);
        return copy;
    }
View Full Code Here

    private void updateTableUsageFields(DatabaseStructure struct, SelectedTables objects) {
        for (DatabaseObject table : objects.getIncludedTables()) {
            int count;
            if (isSchemaNameIncluded) {
                String qualName = quotes.getQualifiedName(table);
                DatabaseObject copy = table.createCopy(qualName);
                count = struct.getUseCount(copy);
            } else {
                count = struct.getUseCount(table);
            }
            if (count == 0) {
View Full Code Here

        @Override
        protected SelectedTables getValueFromUi() {
            SelectedTables value = new SelectedTables();
            for (int row = 0; row < tableModel.getRowCount(); ++row) {
                DatabaseObject o = tableModel.getRowObjectAt(row);
                int count = tableModel.getUseCount(row);
                value.setTableUsage(o, count);
            }
            return value;
        }
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.database.info.DatabaseObject

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.