Package org.jitterbit.integration.database.info

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


            test.dispose();
        }
    }

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


        generator = new XsdNameGenerator("", quotes);
    }

    @Test
    public void ensureSimpleCasesWork() {
        DatabaseTable table = new DatabaseTable("orders", "public");
        assertEquals(table.getName() + ".xsd", generator.getXsdName(table));
    }
View Full Code Here

        assertEquals(table.getName() + ".xsd", generator.getXsdName(table));
    }

    @Test
    public void ensurePossiblyInvalidCharactersAreEscaped() {
        DatabaseTable table = new DatabaseTable("order:details", "public");
        assertEquals("order_details" + ".xsd", generator.getXsdName(table));
    }
View Full Code Here

        assertEquals("order_details" + ".xsd", generator.getXsdName(table));
    }

    @Test
    public void ensureReservedWordsAreDetected() {
        DatabaseTable table = new DatabaseTable("con", "public");
        assertEquals("con_" + ".xsd", generator.getXsdName(table));
        table = new DatabaseTable("NUL", "public");
        assertEquals("NUL_" + ".xsd", generator.getXsdName(table));
    }
View Full Code Here

    }

    @Test
    public void ensureQuotesAreRemoved() {
        String name = "orders";
        DatabaseTable table = new DatabaseTable(quotes.escapeName(name), "public");
        assertEquals(name + ".xsd", generator.getXsdName(table));
    }
View Full Code Here

        assertEquals(name + ".xsd", generator.getXsdName(table));
    }

    @Test
    public void ensureQualifiedNamesAreHandled() {
        DatabaseTable table = new DatabaseTable("orders", "public");
        String qualifiedName = quotes.getQualifiedName(table);
        table = (DatabaseTable) table.createCopy(table.getSchema(), qualifiedName);
        assertEquals("public.orders.xsd", generator.getXsdName(table));
    }
View Full Code Here

    }

    @Test
    public void ensureThatDbNameIsIncludedIfPresent() {
        generator = new XsdNameGenerator("prod", quotes);
        DatabaseTable table = new DatabaseTable("orders", "public");
        assertEquals("prod.orders.xsd", generator.getXsdName(table));
        generator = new XsdNameGenerator("prod:1", quotes);
        table = new DatabaseTable("orders", "public");
        assertEquals("prod_1.orders.xsd", generator.getXsdName(table));
    }
View Full Code Here

        objs[1] = createCharactersTable();
        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

        table.addColumn(new DatabaseColumn(table, "RunningTime", "int", 0, null, false, false));
        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

    private static final String[] SYNONYM_NAMES = { "Beautiful_Handsome", "Quiet_Calm", "Fast_Quick" };

    private static List<DatabaseTable> createTables() {
        List<DatabaseTable> tables = new ArrayList<DatabaseTable>();
        for (int n = 0; n < TABLE_NAMES.length; ++n) {
            DatabaseTable t = new DatabaseTable(TABLE_NAMES[n], "");
            for (DatabaseColumn c : createColumns(t, (n % 2) == 0)) {
                t.addColumn(c);
            }
            tables.add(t);
        }
        return tables;
    }
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.