<action dev="jahlborn" type="update">
Handle input String boolean values.
</action>
+ <action dev="jahlborn" type="add" system="SourceForge2Features" issue="28">
+ Added Database.isLinkedTable method to identify if the given Table is
+ linked to the database.
+ </action>
+ <action dev="jahlborn" type="add" system="SourceForge2Features" issue="28">
+ Added TableIterableBuilder for advanced Table iteration. This allows
+ selectively including different table types when iterating the tables
+ in a Database.
+ </action>
</release>
<release version="2.0.8" date="2014-12-26">
<action dev="jahlborn" type="fix" system="SourceForge2" issue="113">
return _tableFinder.isLinkedTable(table);
}
- boolean matchesLinkedTable(Table table, String linkedTableName,
- String linkedDbName) {
+ private boolean matchesLinkedTable(Table table, String linkedTableName,
+ String linkedDbName) {
return (table.getName().equalsIgnoreCase(linkedTableName) &&
(_linkedDbs != null) &&
(_linkedDbs.get(linkedDbName) == table.getDatabase()));
_includeLinkedTables = includeLinkedTables;
return this;
}
+
+ /**
+ * Convenience method to set the flags to include only non-linked (local)
+ * user tables.
+ */
+ public TableIterableBuilder withLocalUserTablesOnly() {
+ setIncludeNormalTables(true);
+ setIncludeSystemTables(false);
+ return setIncludeLinkedTables(false);
+ }
+
+ /**
+ * Convenience method to set the flags to include only system tables.
+ */
+ public TableIterableBuilder withSystemTablesOnly() {
+ setIncludeNormalTables(false);
+ setIncludeSystemTables(true);
+ return setIncludeLinkedTables(false);
+ }
public Iterator<Table> iterator() {
return ((DatabaseImpl)_db).iterator(this);
assertTrue(tables.contains(t3));
assertFalse(tables.contains(((DatabaseImpl)db).getSystemCatalog()));
- tables = getTables(db.newIterable().setIncludeLinkedTables(false));
+ tables = getTables(db.newIterable().withLocalUserTablesOnly());
assertEquals(1, tables.size());
assertTrue(tables.contains(t1));
assertFalse(tables.contains(t2));
assertFalse(tables.contains(t3));
assertFalse(tables.contains(((DatabaseImpl)db).getSystemCatalog()));
- tables = getTables(db.newIterable().setIncludeLinkedTables(false)
- .setIncludeNormalTables(false)
- .setIncludeSystemTables(true));
+ tables = getTables(db.newIterable().withSystemTablesOnly());
assertTrue(tables.size() > 5);
assertFalse(tables.contains(t1));
assertFalse(tables.contains(t2));