Class TableInfo
java.lang.Object
org.apache.sis.referencing.factory.sql.TableInfo
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
FieldsModifier and TypeFieldDescription(package private) final String
Column name for the code (usually with the"_CODE"
suffix).(package private) static final TableInfo
TheEPSG
item used for coordinate reference systems.(package private) static final TableInfo
TheEPSG
item used for datums.(package private) static final TableInfo
TheEPSG
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), ornull
.(package private) final String
The column that specify if the object should be shown, ornull
if none.private final Class<?>[]
Sub-interfaces oftype
to handle, ornull
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), ornull
.private final String[]
Names ofsubTypes
in the database, ornull
if none. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static boolean
tableMatches
(String expected, String name) Returnstrue
if the given tablename
matches theexpected
name.(package private) final String
unquoted()
Returns the table name without brackets.(package private) final Class<?>
where
(Class<?> userType, StringBuilder buffer) Appends aWHERE
clause together with a condition for searching the most specific subtype, if such condition can be added.
-
Field Details
-
CRS
TheEPSG
item used for coordinate reference systems. -
DATUM
TheEPSG
item used for datums. -
ELLIPSOID
TheEPSG
item used for ellipsoids. -
EPSG
List of tables and columns to test for codes values. Those tables are used by theEPSGDataAccess.createObject(String)
method in order to detect which of the following methods should be invoked for a given code:EPSGDataAccess.createCoordinateReferenceSystem(String)
EPSGDataAccess.createCoordinateSystem(String)
EPSGDataAccess.createDatum(String)
EPSGDataAccess.createEllipsoid(String)
EPSGDataAccess.createUnit(String)
The order is significant: it is the key for aswitch
statement. -
type
The class of object to be created. -
table
The table name for SQL queries. May contains a"JOIN"
clause.- See Also:
-
codeColumn
Column name for the code (usually with the"_CODE"
suffix). -
nameColumn
Column name for the name (usually with the"_NAME"
suffix), ornull
. -
typeColumn
Column type for the type (usually with the"_TYPE"
suffix), ornull
.EPSGDataAccess
andAuthorityCodes
assumes that values in this column have the maximal length described in the "VARCHAR(80)" statement. -
ENUM_REPLACEMENT
The SQL type to use as a replacement for enumerated values on databases that do not support enumerations.- See Also:
-
subTypes
Sub-interfaces oftype
to handle, ornull
if none. -
typeNames
Names ofsubTypes
in the database, ornull
if none. -
showColumn
The column that specify if the object should be shown, ornull
if none.
-
-
Constructor Details
-
Method Details
-
unquoted
Returns the table name without brackets. -
tableMatches
Returnstrue
if the given tablename
matches theexpected
name. The givenname
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 theEPSG_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
Appends aWHERE
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 theWHERE
clause.- Returns:
- the subtype, or
type
if no subtype was found.
-