diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2011-07-29 04:07:11 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2011-07-29 04:07:11 +0000 |
commit | 322d32d4be01471ad9d41fc05e0c5a11c8ec7de0 (patch) | |
tree | 527aba56908f911c4ef7918837a4466e088edbeb /src/java | |
parent | 599d2da23e2d88632133ab178ad3e23cdc204753 (diff) | |
download | jackcess-322d32d4be01471ad9d41fc05e0c5a11c8ec7de0.tar.gz jackcess-322d32d4be01471ad9d41fc05e0c5a11c8ec7de0.zip |
add Database.getSystemTableNames to enable retrieving the list of system/hidden tables
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@570 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/Database.java | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Database.java b/src/java/com/healthmarketscience/jackcess/Database.java index a856b02..7326d69 100644 --- a/src/java/com/healthmarketscience/jackcess/Database.java +++ b/src/java/com/healthmarketscience/jackcess/Database.java @@ -980,13 +980,26 @@ public class Database if(_tableNames == null) { Set<String> tableNames = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); - _tableFinder.getTableNames(tableNames); + _tableFinder.getTableNames(tableNames, false); _tableNames = tableNames; } return _tableNames; } /** + * @return The names of all of the system tables (String). Note, in order + * to read these tables, you must use {@link #getSystemTable}. + * <i>Extreme care should be taken if modifying these tables + * directly!</i>. + */ + public Set<String> getSystemTableNames() throws IOException { + Set<String> sysTableNames = + new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); + _tableFinder.getTableNames(sysTableNames, true); + return sysTableNames; + } + + /** * @return an unmodifiable Iterator of the user Tables in this Database. * @throws IllegalStateException if an IOException is thrown by one of the * operations, the actual exception will be contained within @@ -2015,8 +2028,10 @@ public class Database return ((cur != null) ? cur.getCurrentRow(columns) : null); } - public void getTableNames(Set<String> tableNames) throws IOException { - + public void getTableNames(Set<String> tableNames, + boolean systemTables) + throws IOException + { for(Map<String,Object> row : getTableNamesCursor().iterable( SYSTEM_CATALOG_TABLE_NAME_COLUMNS)) { @@ -2026,7 +2041,7 @@ public class Database int parentId = (Integer)row.get(CAT_COL_PARENT_ID); if((parentId == _tableParentId) && TYPE_TABLE.equals(type) && - !isSystemObject(flags)) { + (isSystemObject(flags) == systemTables)) { tableNames.add(tableName); } } |