Class TableInfo

java.lang.Object
org.apache.sis.referencing.factory.sql.TableInfo

final class TableInfo extends Object
Information about a specific table. The MS-Access dialect of SQL is assumed; it will be translated into ANSI SQL later by SQLTranslator.apply(String) if needed.
Since:
0.7
Version:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final String
    Column name for the code (usually with the "_CODE" suffix).
    (package private) static final TableInfo
    The EPSG item used for coordinate reference systems.
    (package private) static final TableInfo
    The EPSG item used for datums.
    (package private) static final TableInfo
    The EPSG item used for ellipsoids.
    (package private) static final String
    The SQL type to use as a replacement for enumerated values on databases that do not support enumerations.
    (package private) static final TableInfo[]
    List of tables and columns to test for codes values.
    (package private) final String
    Column name for the name (usually with the "_NAME" suffix), or null.
    (package private) final String
    The column that specify if the object should be shown, or null if none.
    private final Class<?>[]
    Sub-interfaces of type to handle, or null if none.
    (package private) final String
    The table name for SQL queries.
    (package private) final Class<?>
    The class of object to be created.
    private final String
    Column type for the type (usually with the "_TYPE" suffix), or null.
    private final String[]
    Names of subTypes in the database, or null if none.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    TableInfo(Class<?> type, String table, String codeColumn, String nameColumn, String typeColumn, Class<?>[] subTypes, String[] typeNames, String showColumn)
    Stores information about a specific table.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static boolean
    tableMatches(String expected, String name)
    Returns true if the given table name matches the expected name.
    (package private) final String
    Returns the table name without brackets.
    (package private) final Class<?>
    where(Class<?> userType, StringBuilder buffer)
    Appends a WHERE clause together with a condition for searching the most specific subtype, if such condition can be added.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • unquoted

      final String unquoted()
      Returns the table name without brackets.
    • tableMatches

      static boolean tableMatches(String expected, String name)
      Returns true if the given table name matches the expected name. The given name may be prefixed by "epsg_" and may contain abbreviations of the full name. For example, "epsg_coordoperation" is considered as a match for "Coordinate_Operation".

      The table name should be one of the values enumerated in the epsg_table_name type of the EPSG_Prepare.sql file.

      Parameters:
      expected - the expected table name (e.g. "Coordinate_Operation").
      name - the actual table name.
      Returns:
      whether the given name is considered to match the expected name.
    • where

      final Class<?> where(Class<?> userType, StringBuilder buffer)
      Appends a WHERE clause together with a condition for searching the most specific subtype, if such condition can be added. The clause appended by this method looks like the following example (details may vary because of enumeration values): In any case, the caller shall add at least one condition after this method call.
      Parameters:
      userType - the type specified by the user.
      buffer - where to append the WHERE clause.
      Returns:
      the subtype, or type if no subtype was found.