Package com.healthmarketscience.jackcess
Interface TableNameMap
-
- All Superinterfaces:
Iterable<NameMap.Record>,NameMap
- All Known Implementing Classes:
TableNameMapImpl
public interface TableNameMap extends NameMap
The name map of a table, which ms access stores in the "NameMap" property of the table. It holds a record for the table, a record for each column, and a record for each name which an expression in the table uses.Ms access leaves the records different from the table in some cases: a table renamed from the navigation pane keeps its old name in the table record until the next design save, and some tables carry the name map of another table, with guids which are not their own. A column name is the more reliable way to find a column record.
- Author:
- James Ahlborn
- Usage:
- Intermediate: This class requires moderate API knowledge.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.healthmarketscience.jackcess.NameMap
NameMap.Mismatch, NameMap.MismatchType, NameMap.Record, NameMap.RecordType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NameMap.RecordaddColumn(String name, String guid)Adds a column record before the end record.List<NameMap.Mismatch>findMismatches()Compares the table and column records with the table which holds this name map.NameMap.RecordgetColumnRecord(String name)List<NameMap.Record>getReferences()NameMap.RecordgetTableRecord()NameMap.RecordremoveColumn(String name)Removes the column record with the given name (case-insensitive).voidsave()Writes the name map into the table property and saves the properties of the table.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface com.healthmarketscience.jackcess.NameMap
getColumnRecords, getRecord, getTableRecords, getWriterTag, stream
-
-
-
-
Method Detail
-
getTableRecord
NameMap.Record getTableRecord()
- Returns:
- the record for the table, or
nullif there is none
-
getColumnRecord
NameMap.Record getColumnRecord(String name)
- Returns:
- the column record with the given name (case-insensitive), or
nullif there is none
-
getReferences
List<NameMap.Record> getReferences()
- Returns:
- the records for the names which expressions in the table use, in the order of the name map
-
addColumn
NameMap.Record addColumn(String name, String guid)
Adds a column record before the end record.- Parameters:
name- the column nameguid- the guid of the column, which must be the same as the "GUID" property of the column- Returns:
- the new record
- Throws:
IllegalStateException- if the name map has no table recordIllegalArgumentException- if the guid is not valid
-
removeColumn
NameMap.Record removeColumn(String name)
Removes the column record with the given name (case-insensitive).- Returns:
- the removed record, or
nullif there is none
-
findMismatches
List<NameMap.Mismatch> findMismatches() throws IOException
Compares the table and column records with the table which holds this name map. A column is found by its guid, and by its name when it has no guid or no record carries it.- Specified by:
findMismatchesin interfaceNameMap- Returns:
- every difference, empty if the name map agrees with the table
- Throws:
IOException
-
save
void save() throws IOException
Writes the name map into the table property and saves the properties of the table.- Throws:
IOException
-
-