use of org.apache.cayenne.dbsync.reverse.filters.PatternFilter in project cayenne by apache.
the class DbRelationshipDictionary method filter.
/**
* @since 4.1
*/
private Collection<DbRelationship> filter() {
if (filtersConfig == null) {
return container.getRelationships();
}
Collection<DbRelationship> existingFiltered = new LinkedList<>();
TableFilter tableFilter = filtersConfig.tableFilter(container.getCatalog(), container.getSchema());
if (tableFilter != null && tableFilter.isIncludeTable(container.getName())) {
PatternFilter patternFilter = tableFilter.getIncludeTableColumnFilter(container.getName());
for (DbRelationship rel : container.getRelationships()) {
if (patternFilter.isIncluded(rel.getName())) {
existingFiltered.add(rel);
}
}
}
return existingFiltered;
}
Aggregations