use of org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable in project cayenne by apache.
the class FiltersConfigBuilderTest method includeTable.
protected IncludeTable includeTable(String name, String incCol, String excCol) {
IncludeTable incTable01 = new IncludeTable(name);
incTable01.addIncludeColumn(new IncludeColumn(incCol));
incTable01.addExcludeColumn(new ExcludeColumn(excCol));
return incTable01;
}
use of org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable in project cayenne by apache.
the class FiltersConfigBuilderTest method testCompact_02.
@Test
public void testCompact_02() {
ReverseEngineering engineering = new ReverseEngineering();
engineering.addCatalog(new Catalog("catalogName"));
engineering.addSchema(new Schema("schemaName01"));
engineering.addSchema(new Schema("schemaName02"));
engineering.addIncludeTable(new IncludeTable("table1"));
engineering.addExcludeTable(new ExcludeTable("table2"));
engineering.addIncludeColumn(new IncludeColumn("includeColumn"));
FiltersConfigBuilder builder = new FiltersConfigBuilder(engineering);
builder.compact();
assertEquals("ReverseEngineering: \n" + " Catalog: catalogName\n" + " Schema: schemaName01\n" + " IncludeTable: table1\n" + " IncludeColumn: includeColumn\n" + " ExcludeTable: table2\n" + " Schema: schemaName02\n" + " IncludeTable: table1\n" + " IncludeColumn: includeColumn\n" + " ExcludeTable: table2\n\n" + " Use primitives", engineering.toString());
}
use of org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable in project cayenne by apache.
the class DatabaseSchemaLoader method addColumn.
private void addColumn(FilterContainer filterContainer, IncludeTable table, String columnName) {
if (columnName == null) {
return;
}
filterContainer = filterContainer == null ? databaseReverseEngineering : filterContainer;
IncludeTable foundTable = getTableByName(filterContainer.getIncludeTables(), table.getPattern());
table = foundTable != null ? foundTable : table;
IncludeColumn includeColumn = new IncludeColumn(columnName);
table.addIncludeColumn(includeColumn);
}
use of org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable in project cayenne by apache.
the class DatabaseSchemaLoader method packTable.
private void packTable(String tableName, String catalogName, String schemaName, String columnName) {
IncludeTable table = new IncludeTable();
table.setPattern(tableName);
if (catalogName == null && schemaName == null) {
if (!databaseReverseEngineering.getIncludeTables().contains(table)) {
databaseReverseEngineering.addIncludeTable(table);
}
addColumn(null, table, columnName);
return;
}
FilterContainer filterContainer = packFilterContainer(catalogName, schemaName);
addTable(filterContainer, table);
addColumn(filterContainer, table, columnName);
}
use of org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable in project cayenne by apache.
the class DbImportTree method printCatalogs.
private void printCatalogs(Collection<Catalog> catalogs, DbImportTreeNode parent) {
for (Catalog catalog : catalogs) {
DbImportTreeNode node = !isTransferable ? new DbImportTreeNode(catalog) : new TransferableNode(catalog);
if (!"".equals(node.getSimpleNodeName())) {
if (isTransferable && catalog.getSchemas().isEmpty() && catalog.getIncludeTables().isEmpty() && catalog.getExcludeTables().isEmpty()) {
printParams(Collections.singletonList(new IncludeTable("Loading...")), node);
}
printSchemas(catalog.getSchemas(), node);
printChildren(catalog, node);
parent.add(node);
}
}
}
Aggregations