Package org.jitterbit.integration.database.info

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


        addSegmentForTable(tableNode, root.getName(), structure, new HashSet<String>());
        return structure;
    }

    private void addSegmentForTable(Node tableNode, String parentName, ComplexTextStructure structure, Set<String> identifiers) {
        DatabaseObject table = tableNode.getTable();
        SchemaAndTableNameSeparator nameSeparator = new SchemaAndTableNameSeparator(table.getName(), quotes);
        String tableName = nameSeparator.getTable();
        String id = getSegmentId(tableName, identifiers);
        Segment segment = createSegment(table, id);
        String segmentName = TextStructureNameUtils.replaceIllegalCharacters(tableName);
        segment.setName(segmentName);
View Full Code Here


    private void validateNewRelation(TableRelationship newRelation) {
        if (isAncestor(newRelation.getChildObject(), newRelation.getParentObject())) {
            throw new IllegalRelationException(newRelation.getChildObject().getName() + " is an ancestor of " + newRelation.getParentObject().getName());
        }
        DatabaseObject child = newRelation.getChildObject();
        for (TableRelationship r : relations) {
            if (r.getChildObject() == child) {
                if (r.getParentObject() == newRelation.getParentObject()) {
                    remove(r);
                    break;
                }
                throw new IllegalRelationException(child.getName() + " is already linked to another parent table");
            }
        }
    }
View Full Code Here

            removeTable(child);
        }
    }
   
    public void removeFromParent(DatabaseObject table) {
        DatabaseObject parent = getParent(table);
        if (parent != null) {
            TableRelationship r = getRelation(parent, table);
            remove(r);
        }
    }
View Full Code Here

    public DatabaseObject getParent(DatabaseObject child) {
        return childToParent.get(child);
    }
   
    public boolean isAncestor(DatabaseObject ancestor, DatabaseObject descendant) {
        DatabaseObject parent = childToParent.get(descendant);
        while (parent != null) {
            if (parent == ancestor) {
                return true;
            }
            parent = childToParent.get(parent);
View Full Code Here

        return null;
    }

    private boolean isTableNodeAccepted(TreeTableNode node) {
        if (node instanceof DatabaseTableNode) {
            DatabaseObject table = (DatabaseObject) node.getUserObject();
            return filter.acceptsTable(table);
        }
        return true;
    }
View Full Code Here

    }

    @Override
    protected Transferable createTransferable(JComponent c) {
        JXTreeTable tree = (JXTreeTable) c;
        DatabaseObject selectedObject = null;
        List<DatabaseColumn> selectedColumns = null;
        for (int row : tree.getSelectedRows()) {
            Object o = tree.getValueAt(row, 0);
            if (o instanceof DatabaseObject) {
                if (selectedObject == null) {
View Full Code Here

    public DatabaseObject[] getDatabaseObjects() {
        synchronized (getDataLock()) {
            BeginEndQuote quotes = getBeginEndQuote();
            List<DatabaseObject> objs = Lists.newArrayList();
            for (Map.Entry<DatabaseObject, Integer> e : objects.entrySet()) {
                DatabaseObject o = e.getKey();
                objs.add(o);
                for (int i = 2; i <= e.getValue().intValue(); ++i) {
                    DatabaseObject alias = AliasNameGenerator.createAlias(o, i, quotes);
                    objs.add(alias);
                }
            }
            return objs.toArray(new DatabaseObject[objs.size()]);
        }
View Full Code Here

    public static void main(String[] args) throws Exception {
        ConnectionParams params = createParams();
        SourceId sourceGuid = new SourceId("475118e7-1b59-4371-bc09-598c19b12385");
        ConnectionFactory connectionFactory = new DefaultConnectionFactory(params, sourceGuid, null);
        DatabaseColumnRetriever r = new DatabaseColumnRetriever(connectionFactory);
        DatabaseObject table = new DatabaseTable("OrderDetail", "public");
        r.populateColumns(new DatabaseObject[] { table });
        for (DatabaseColumn col : table.getAllColumns()) {
            System.out.println(col);
        }
    }
View Full Code Here

        }
    }

    private static Node buildFlatTree(DatabaseStructure structure) {
        DatabaseObject[] tables = structure.getDatabaseObjects();
        DatabaseObject table = tables[0];
        return new Node(table);
    }
View Full Code Here

        }

        private Node getNodeForTable(String tableName) {
            Node node = nameToNode.get(tableName);
            if (node == null) {
                DatabaseObject table = nameToTable.get(tableName);
                if (table == null) {
                    throw new RuntimeException("Unknown table: " + tableName);
                }
                node = new Node(table);
                nameToNode.put(tableName, node);
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.