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 StringColumn name for the code (usually with the"_CODE"suffix).(package private) static final TableInfoTheEPSGitem used for coordinate reference systems.(package private) static final TableInfoTheEPSGitem used for datums.(package private) static final TableInfoTheEPSGitem used for ellipsoids.(package private) static final StringThe 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 StringColumn name for the name (usually with the"_NAME"suffix), ornull.(package private) final StringThe column that specify if the object should be shown, ornullif none.private final Class<?>[]Sub-interfaces oftypeto handle, ornullif none.(package private) final StringThe table name for SQL queries.(package private) final Class<?>The class of object to be created.private final StringColumn type for the type (usually with the"_TYPE"suffix), ornull.private final String[]Names ofsubTypesin the database, ornullif none. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static booleantableMatches(String expected, String name) Returnstrueif the given tablenamematches theexpectedname.(package private) final Stringunquoted()Returns the table name without brackets.(package private) final Class<?>where(Class<?> userType, StringBuilder buffer) Appends aWHEREclause together with a condition for searching the most specific subtype, if such condition can be added.
-
Field Details
-
CRS
TheEPSGitem used for coordinate reference systems. -
DATUM
TheEPSGitem used for datums. -
ELLIPSOID
TheEPSGitem 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 aswitchstatement. -
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.EPSGDataAccessandAuthorityCodesassumes 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 oftypeto handle, ornullif none. -
typeNames
Names ofsubTypesin the database, ornullif none. -
showColumn
The column that specify if the object should be shown, ornullif none.
-
-
Constructor Details
-
Method Details
-
unquoted
Returns the table name without brackets. -
tableMatches
Returnstrueif the given tablenamematches theexpectedname. The givennamemay 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_nametype of theEPSG_Prepare.sqlfile.- Parameters:
expected- the expected table name (e.g."Coordinate_Operation").name- the actual table name.- Returns:
- whether the given
nameis considered to match the expected name.
-
where
Appends aWHEREclause 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 theWHEREclause.- Returns:
- the subtype, or
typeif no subtype was found.
-