use of org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer in project cayenne by apache.
the class EditNodeAction method performAction.
@Override
public void performAction(ActionEvent e) {
if (tree.isEditing()) {
return;
}
if (e != null) {
if (tree.getSelectionPath() != null) {
tree.startEditingAtPath(tree.getSelectionPath());
}
}
if (actionName == null) {
return;
}
if (tree.getSelectionPath() != null) {
selectedElement = tree.getSelectedNode();
parentElement = (DbImportTreeNode) selectedElement.getParent();
if (parentElement != null) {
Object selectedObject = selectedElement.getUserObject();
ReverseEngineering reverseEngineeringOldCopy = new ReverseEngineering(tree.getReverseEngineering());
if (!Util.isEmptyString(actionName)) {
if (selectedObject instanceof FilterContainer) {
((FilterContainer) selectedObject).setName(actionName);
} else if (selectedObject instanceof PatternParam) {
((PatternParam) selectedObject).setPattern(actionName);
}
updateModel(true);
selectedElement = null;
}
if (!actionName.equals(EMPTY_NAME)) {
putReverseEngineeringToUndoManager(reverseEngineeringOldCopy);
}
}
}
}
use of org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer in project cayenne by apache.
the class SchemaTableNode method getContainers.
@Override
List<FilterContainer> getContainers(ReverseEngineering config) {
List<FilterContainer> containers = new ArrayList<>();
if (getParent() != null && getParent().getParent() != null) {
Catalog catalog = getParent().getParent().getCatalog(config);
if (catalog != null) {
containers.add(getParent().getSchema(catalog));
containers.add(catalog);
}
containers.add(getParent().getSchema(config));
}
containers.add(config);
return containers;
}
use of org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer in project cayenne by apache.
the class TableNode method getStatus.
@Override
public Status getStatus(ReverseEngineering config) {
T parent = getParent();
if (parent != null) {
Status parentStatus = parent.getStatus(config);
if (parentStatus != Status.INCLUDE) {
return parentStatus;
}
}
List<IncludeTable> includeTables = new ArrayList<>();
List<ExcludeTable> excludeTables = new ArrayList<>();
for (FilterContainer container : getContainers(config)) {
if (container == null) {
continue;
}
includeTables.addAll(container.getIncludeTables());
excludeTables.addAll(container.getExcludeTables());
}
return includesTable(includeTables, excludeTables);
}
use of org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer in project cayenne by apache.
the class SchemaProcedureNode method getContainers.
@Override
List<FilterContainer> getContainers(ReverseEngineering config) {
List<FilterContainer> containers = new ArrayList<>();
if (getParent() != null && getParent().getParent() != null) {
Catalog catalog = getParent().getParent().getCatalog(config);
if (catalog != null) {
containers.add(getParent().getSchema(catalog));
containers.add(catalog);
}
containers.add(getParent().getSchema(config));
}
containers.add(config);
return containers;
}
use of org.apache.cayenne.dbsync.reverse.dbimport.FilterContainer 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);
}
Aggregations