Package org.jitterbit.integration.database.info

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


        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


        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

                    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
        public boolean isCellEditable(int rowIndex, int columnIndex) {
            if (columnIndex == 2) {
                DatabaseColumn col = getRowObjectAt(rowIndex);
                return !updateKeys.contains(col);
            }
            return super.isCellEditable(rowIndex, columnIndex);
        }
View Full Code Here

            return super.isCellEditable(rowIndex, columnIndex);
        }

        public void populateColumnValues(List<DatabaseColumn> columns, List<String> values) {
            for (int row = 0; row < getRowCount(); ++row) {
                DatabaseColumn col = getRowObjectAt(row);
                if (!updateKeys.contains(col)) {
                    String value = (String) getValueAt(row, 2);
                    if (StringUtils.isNotBlank(value)) {
                        columns.add(col);
                        values.add(value.trim());
View Full Code Here

            Map<DatabaseColumn, String> updateValues = Maps.newHashMap();
            for (UpdateValue uv : fields.getUpdateValues(obj)) {
                updateValues.put(uv.getColumn(), uv.getValue());
            }
            for (int row = 0; row < getRowCount(); ++row) {
                DatabaseColumn col = getRowObjectAt(row);
                String value = updateValues.get(col);
                setValueAt(value, row, 2);
            }
        }
View Full Code Here

        @Override
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                        boolean hasFocus, int rowIndex, int columnIndex) {
            super.getTableCellRendererComponent(table, value, isSelected, hasFocus, rowIndex, columnIndex);
            TableModel model = (TableModel) table.getModel();
            DatabaseColumn column = model.getRowObjectAt(rowIndex);
            boolean enabled = !updateKeys.contains(column);
            setEnabled(enabled);
            return this;
        }
View Full Code Here

        return objs;
    }
   
    private DatabaseTable createEpisodesTable() {
        DatabaseTable table = new DatabaseTable("Episodes", "Seinfeld");
        DatabaseColumn col = new DatabaseColumn(table, "EpisodeId", "int", 0, null, false, true);
        table.addColumn(col);
        table.addColumn(new DatabaseColumn(table, "SeasonId", "int", 0, null, false, false));
        table.addColumn(new DatabaseColumn(table, "Name", "string", 0, null, false, false));
        table.addColumn(new DatabaseColumn(table, "RunningTime", "int", 0, null, false, false));
        return table;
    }
View Full Code Here

        return table;
    }

    private DatabaseTable createCharactersTable() {
        DatabaseTable table = new DatabaseTable("Characters", "Seinfeld");
        DatabaseColumn col = new DatabaseColumn(table, "CharacterId", "int", 0, null, false, true);
        table.addColumn(col);
        table.addColumn(new DatabaseColumn(table, "EpisodeId", "int", 0, null, false, true));
        table.addColumn(new DatabaseColumn(table, "Name", "string", 0, null, false, true));
        return table;
    }
View Full Code Here

        public void setSelectedColumns(DatabaseStructure struct, DatabaseObject obj) {
            DbFields fields = struct.getDbFields();
            Set<DatabaseColumn> keys = Sets.newHashSet(fields.getUpdateKeys(obj));
            for (int row = 0; row < getRowCount(); ++row) {
                DatabaseColumn col = getRowObjectAt(row);
                boolean selected = keys.contains(col);
                setValueAt(selected, row, 2);
            }
        }
View Full Code Here

TOP

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

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.