Search in sources :

Example 6 with IncludeProcedure

use of org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure in project cayenne by apache.

the class ProcedureNode method getStatus.

@Override
public Status getStatus(ReverseEngineering config) {
    Status parentStatus = getParent().getStatus(config);
    if (parentStatus != Status.INCLUDE) {
        return parentStatus;
    }
    List<IncludeProcedure> includeProcedures = new ArrayList<>();
    List<ExcludeProcedure> excludeProcedures = new ArrayList<>();
    for (FilterContainer container : getContainers(config)) {
        if (container == null) {
            continue;
        }
        includeProcedures.addAll(container.getIncludeProcedures());
        excludeProcedures.addAll(container.getExcludeProcedures());
    }
    return includesProcedure(includeProcedures, excludeProcedures);
}
Also used : FilterContainer(org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer) ArrayList(java.util.ArrayList) ExcludeProcedure(org.apache.cayenne.dbsync.reverse.dbimport.ExcludeProcedure) IncludeProcedure(org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure)

Example 7 with IncludeProcedure

use of org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure in project cayenne by apache.

the class PatternParamTest method toIncludeProcedure.

@Test
public void toIncludeProcedure() throws Exception {
    IncludeProcedure table = param.toIncludeProcedure();
    assertNotNull(table);
    assertEquals("test", table.getPattern());
}
Also used : IncludeProcedure(org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure) Test(org.junit.Test)

Example 8 with IncludeProcedure

use of org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure in project cayenne by apache.

the class AddPatternParamAction method addPatternParamToContainer.

private void addPatternParamToContainer(Class paramClass, Object selectedObject, String name, DbImportTreeNode node) {
    FilterContainer container = (FilterContainer) selectedObject;
    PatternParam element = null;
    if (paramClass == ExcludeTable.class) {
        element = new ExcludeTable(name);
        container.addExcludeTable((ExcludeTable) element);
    } else if (paramClass == IncludeColumn.class) {
        element = new IncludeColumn(name);
        container.addIncludeColumn((IncludeColumn) element);
    } else if (paramClass == ExcludeColumn.class) {
        element = new ExcludeColumn(name);
        container.addExcludeColumn((ExcludeColumn) element);
    } else if (paramClass == IncludeProcedure.class) {
        element = new IncludeProcedure(name);
        container.addIncludeProcedure((IncludeProcedure) element);
    } else if (paramClass == ExcludeProcedure.class) {
        element = new ExcludeProcedure(name);
        container.addExcludeProcedure((ExcludeProcedure) element);
    }
    node.add(new DbImportTreeNode(element));
}
Also used : PatternParam(org.apache.cayenne.dbsync.reverse.dbimport.PatternParam) DbImportTreeNode(org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode) FilterContainer(org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer) ExcludeColumn(org.apache.cayenne.dbsync.reverse.dbimport.ExcludeColumn) ExcludeProcedure(org.apache.cayenne.dbsync.reverse.dbimport.ExcludeProcedure) IncludeColumn(org.apache.cayenne.dbsync.reverse.dbimport.IncludeColumn) IncludeProcedure(org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure) ExcludeTable(org.apache.cayenne.dbsync.reverse.dbimport.ExcludeTable)

Aggregations

IncludeProcedure (org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure)8 ExcludeProcedure (org.apache.cayenne.dbsync.reverse.dbimport.ExcludeProcedure)5 ExcludeTable (org.apache.cayenne.dbsync.reverse.dbimport.ExcludeTable)4 Catalog (org.apache.cayenne.dbsync.reverse.dbimport.Catalog)3 ExcludeColumn (org.apache.cayenne.dbsync.reverse.dbimport.ExcludeColumn)3 IncludeColumn (org.apache.cayenne.dbsync.reverse.dbimport.IncludeColumn)3 Schema (org.apache.cayenne.dbsync.reverse.dbimport.Schema)3 FilterContainer (org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer)2 IncludeTable (org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable)2 ReverseEngineering (org.apache.cayenne.dbsync.reverse.dbimport.ReverseEngineering)2 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1 DbImportConfiguration (org.apache.cayenne.dbsync.reverse.dbimport.DbImportConfiguration)1 PatternParam (org.apache.cayenne.dbsync.reverse.dbimport.PatternParam)1 DbLoaderDelegate (org.apache.cayenne.dbsync.reverse.dbload.DbLoaderDelegate)1 FiltersConfigBuilder (org.apache.cayenne.dbsync.reverse.filters.FiltersConfigBuilder)1 DbImportTreeNode (org.apache.cayenne.modeler.dialog.db.load.DbImportTreeNode)1 DBConnectionInfo (org.apache.cayenne.modeler.pref.DBConnectionInfo)1