Interface NameMap

  • All Superinterfaces:
    Iterable<NameMap.Record>
    All Known Subinterfaces:
    TableNameMap
    All Known Implementing Classes:
    NameMapImpl, QueryNameMapImpl, TableNameMapImpl

    public interface NameMap
    extends Iterable<NameMap.Record>
    A name map, the data behind the ms access "Name AutoCorrect" option. It holds a record for each table and column an object depends on, tied to the guid in the "GUID" property of that table or column. When a table or column is renamed, ms access finds the old name here and changes the places which use it.

    Two kinds of object carry one:

    • a table, in its "NameMap" property, which Table.getNameMap() reads as a TableNameMap
    • a query, in its "DOL" property, which Query.getNameMap() reads. It has a table record for each table or query the query uses and a column record for each column it uses. It cannot be changed, because ms access repairs a query when it finds a record whose guid now names an object with a different name, and a record changed without the sql of the query would stop that repair
    Ms access does not require a name map, and nothing in jackcess updates one when a table changes, so the records can disagree with the database. findMismatches() lists where they do.
    Author:
    James Ahlborn
    Usage:
    Intermediate: This class requires moderate API knowledge.
    • Method Detail

      • getTableRecords

        List<NameMap.Record> getTableRecords()
        Returns:
        the table records, in the order of the name map
      • getColumnRecords

        List<NameMap.Record> getColumnRecords()
        Returns:
        the column records, in the order of the name map
      • getRecord

        NameMap.Record getRecord​(String guid)
        Returns:
        the first table or column record with the given guid, or null if there is none
      • getWriterTag

        Integer getWriterTag()
        Returns:
        the tag in the end record, which is a value of the ms access build which wrote the name map, or null if the name map has no end record
      • findMismatches

        List<NameMap.Mismatch> findMismatches()
                                       throws IOException
        Compares the table and column records with the tables and columns they name.
        Returns:
        every difference, empty if the name map agrees with the database
        Throws:
        IOException