Package org.jitterbit.integration.data.structure.database

Examples of org.jitterbit.integration.data.structure.database.FieldRelationship


                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));
                }
            }
        }
        DbTranRelations copy = new DbTranRelations();
View Full Code Here


    @Test
    public void testGetLinkKeys() {
        rels.add(orderToOrderDetails());
        List<FieldRelationship> linkKeys = rels.getLinkKeys(ordersTab, orderDetailsTab);
        assertEquals(1, linkKeys.size());
        FieldRelationship link = linkKeys.get(0);
        assertEquals("OrderId", link.getParentColumn().getName());
        assertEquals("OrderId", link.getChildColumn().getName());
        assertTrue(rels.getLinkKeys(ordersTab, orderLogTab).isEmpty());
    }
View Full Code Here

    public void testReplaceExistingRelation() {
        rels.add(orderToOrderDetails());
        rels.add(weirdOrderToOrderDetails());
        List<FieldRelationship> linkKeys = rels.getLinkKeys(ordersTab, orderDetailsTab);
        assertEquals(1, linkKeys.size());
        FieldRelationship link = linkKeys.get(0);
        assertEquals("CustomerId", link.getParentColumn().getName());
        assertEquals("OrderId", link.getChildColumn().getName());
        assertTrue(rels.usesAllObjects(Arrays.asList(ordersTab, orderDetailsTab)));
        assertTrue(rels.hasSingleRoot());
    }
View Full Code Here

        List<FieldRelationship> links = Lists.newArrayList();
        List<Pair<Object, Object>> connections = lists.getConnections();
        for (Pair<Object, Object> pair : connections) {
            DatabaseColumn pk = (DatabaseColumn) pair.first;
            DatabaseColumn fk = (DatabaseColumn) pair.second;
            links.add(new FieldRelationship(pk, fk));
        }
        relation.setFieldRelationships(links);
    }
View Full Code Here

        public FieldRelationship getLink() {
            DatabaseColumn parentKey = (DatabaseColumn) parentSelector.getSelectedItem();
            DatabaseColumn childKey = (DatabaseColumn) childSelector.getSelectedItem();
            if (parentKey != null && childKey != null) {
                return new FieldRelationship(parentKey, childKey);
            }
            return null;
        }
View Full Code Here

            parentSelector.requestFocusInWindow();
        }

        @Override
        public void actionPerformed(ActionEvent e) {
            FieldRelationship link = getLink();
            if (link != null) {
                links.add(link);
                existingLinkDisplayer.update();
                existingLinkDisplayer.select(link);
                clearSelection();
View Full Code Here

TOP

Related Classes of org.jitterbit.integration.data.structure.database.FieldRelationship

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.