Package org.jitterbit.integration.database.info

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


        return new DatabaseTable(qualifiedName, schema);
    }
   
    @Test
    public void ensureCoincidentalSchemaMatchDoesNotGiveFalsePositive() {
        DatabaseTable table = createTableWithoutSchemaInName();
        BeginEndQuote guessed = BeginEndQuoteGuesser.guess(table);
        assertNull(guessed);
    }
View Full Code Here


    }

    private DatabaseTable createTableWithoutSchemaInName() {
        String schema = "MDB";
        String tableName = "MDB_ORDERS";
        return new DatabaseTable(tableName, schema);
    }
View Full Code Here

*/
public class FieldRelationshipJUnitTest {

    @Test
    public void testGetters() {
        DatabaseTable orders = new DatabaseTable("orders", "public");
        DatabaseColumn pk = new DatabaseColumn(orders, "orderid", "serial", 0, null, false, true);
        DatabaseTable orderDetails = new DatabaseTable("order details", "public");
        DatabaseColumn fk = new DatabaseColumn(orderDetails, "orderid", "int", 0, null, false, false);
        FieldRelationship rel = new FieldRelationship(pk, fk);
        assertSame(rel.getParentColumn(), pk);
        assertSame(rel.getChildColumn(), fk);
    }
View Full Code Here

        assertSame(rel.getChildColumn(), fk);
    }
   
    @Test
    public void testEquality() {
        DatabaseTable orders = new DatabaseTable("orders", "public");
        DatabaseColumn pk = new DatabaseColumn(orders, "orderid", "serial", 0, null, false, true);
        DatabaseTable orderDetails = new DatabaseTable("order details", "public");
        DatabaseColumn fk = new DatabaseColumn(orderDetails, "orderid", "int", 0, null, false, false);
        FieldRelationship rel_1 = new FieldRelationship(pk, fk);
        FieldRelationship rel_2 = new FieldRelationship(pk, fk);
        FieldRelationship rel_3 = new FieldRelationship(pk, pk);
        assertEquals(rel_1, rel_2);
View Full Code Here

        @Override
        public void visit(TreeElement element) {
            Pair<String, String> schemaAndTableName = getSchemaAndTableName(element);
            String schema = schemaAndTableName.first;
            String table = schemaAndTableName.second;
            current = new DatabaseTable(table, schema);
            objects.add(current);
        }
View Full Code Here

            DbTablesFactory factory = new DbTablesFactory(alias);
            return factory.create(tableUsage, quotes);
        }

        private DatabaseTable createOrdersTable() {
            DatabaseTable table = new DatabaseTable("Orders", "public");
            DatabaseColumn col = new DatabaseColumn(table, "OrderId", "int", 0, null, false, true);
            table.addColumn(col);
            table.addColumn(new DatabaseColumn(table, "CustomerId", "int", 0, null, false, false));
            table.addColumn(new DatabaseColumn(table, "OrderDate", "date", 0, null, false, false));
            table.addColumn(new DatabaseColumn(table, "ShippedDate", "date", 0, null, false, false));
            table.addColumn(new DatabaseColumn(table, "ShipVia", "int", 0, null, false, false));
            return checkSchema(table);
        }
View Full Code Here

            table.addColumn(new DatabaseColumn(table, "ShipVia", "int", 0, null, false, false));
            return checkSchema(table);
        }

        private DatabaseTable createOrderDetailsTable() {
            DatabaseTable table = new DatabaseTable(quotes.escapeNameIfNeeded("Order Details"), "public");
            DatabaseColumn col = new DatabaseColumn(table, "OrderId", "int", 0, null, false, true);
            table.addColumn(col);
            col = new DatabaseColumn(table, "ProductId", "int", 0, null, false, true);
            table.addColumn(col);
            table.addColumn(new DatabaseColumn(table, "UnitPrice", "money", 0, null, false, false));
            table.addColumn(new DatabaseColumn(table, "Quantity", "int", 0, null, false, false));
            return checkSchema(table);
        }
View Full Code Here

            table.addColumn(new DatabaseColumn(table, "Quantity", "int", 0, null, false, false));
            return checkSchema(table);
        }

        private DatabaseTable createOrderLogTable() {
            DatabaseTable table = new DatabaseTable(quotes.escapeNameIfNeeded("Order.Log"), "public");
            DatabaseColumn col = new DatabaseColumn(table, "OrderId", "int", 0, null, false, true);
            table.addColumn(col);
            table.addColumn(new DatabaseColumn(table, quotes.escapeNameIfNeeded("Log.A"), "string", 0, null, false, false));
            table.addColumn(new DatabaseColumn(table, quotes.escapeNameIfNeeded("Log.B"), "string", 0, null, false, false));
            return checkSchema(table);
        }
View Full Code Here

*/
public final class UpdateKeyStringConverterJUnitTest {
   
    @Test
    public void run() {
        DatabaseTable table = new DatabaseTable("Orders", "");
        DatabaseColumn[] columns = {
            new DatabaseColumn(table, "OrderID", "int", 0, null, false, false),
            new DatabaseColumn(table, "OrderDate", "date", 0, null, false, false),
            new DatabaseColumn(table, "CustomerID", "int", 0, null, false, false),
            new DatabaseColumn(table, "Status", "String", 0, null, false, false),
        };
        for (DatabaseColumn c : columns) {
            table.addColumn(c);
        }
        DatabaseColumn[] keys = new DatabaseColumn[] { columns[0], columns[1] };
        String s = UpdateKeyStringConverter.toString(Arrays.asList(keys));
        DatabaseColumn[] parsedColumns = UpdateKeyStringConverter.fromString(s, table);
        assertEquals(Sets.newHashSet(keys), Sets.newHashSet(parsedColumns));
View Full Code Here

    @Test
    public void testProperties() {
        String name = "orders";
        String schema = "public";
        DatabaseTable table = new DatabaseTable(name, schema);
        assertEquals(name, table.getName());
        assertEquals(schema, table.getSchema());
    }
View Full Code Here

TOP

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

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.