public class SqlConstants extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CRLF |
static String |
DEFAULT_CODE_NAME_COLUMN_NAME |
static int |
DEFAULT_CODE_NAME_SIZE |
static int |
DEFAULT_CODESTATUSCL_LENGTH |
static String |
DEFAULT_CODESTATUSCL_TYPE |
static boolean |
DEFAULT_CREATE_DOCUMENTATION |
static boolean |
DEFAULT_CREATE_REFERNCES |
static String |
DEFAULT_FOREIGN_KEY_COLUMN_SUFFIX |
static String |
DEFAULT_FOREIGN_KEY_COLUMN_SUFFIX_DATATYPE |
static String |
DEFAULT_ID_COLUMN_NAME |
static String |
DEFAULT_NAME_CODESTATUS_CL_COLUMN |
static String |
DEFAULT_NAME_CODESTATUSNOTES_COLUMN |
static String |
DEFAULT_ONE_TO_MANY_REF_COLUMN_NAME |
static String |
DEFAULT_PRIMARYKEY_SPEC |
static String |
DEFAULT_PRIMARYKEY_SPEC_CODELIST |
static int |
DEFAULT_SIZE |
static int |
DEFAULT_SRID |
static String |
DESCRIPTORS_FOR_CODELIST_REGEX
(name|documentation|alias|definition|description|example|legalBasis|dataCaptureStatement|primaryCode)(\(((columnName|size|columnDocumentation)=([^,;\)]|(?
|
static String |
INDENT |
static String |
MAP_TARGETTYPE_COND_PART |
static String |
MAP_TARGETTYPE_COND_TEXTORCHARACTERVARYING |
static String |
ME_PARAM_DEFAULTVALUE
Name of the parameter to provide characteristics for encoding an initial
value of an attribute as a default value.
|
static String |
ME_PARAM_DEFAULTVALUE_CHARACT_FALSE
Characteristic for the parameter "defaultValue" that
specifies the value to represent the Boolean value 'false' in the mapping
that the parameter applies to.
|
static String |
ME_PARAM_DEFAULTVALUE_CHARACT_QUOTED
Characteristic for the parameter "defaultValue" that, if
set to 'true' (ignoring case) specifies that the default value shall be
quoted.
|
static String |
ME_PARAM_DEFAULTVALUE_CHARACT_TRUE
Characteristic for the parameter "defaultValue" that
specifies the value to represent the Boolean value 'true' in the mapping
that the parameter applies to.
|
static String |
ME_PARAM_GEOMETRY
Name of the parameter to indicate (via the 'param' attribute) that a map
entry contains information about a geometry type.
|
static String |
ME_PARAM_LENGTH
The target type can have a length.
|
static String |
ME_PARAM_PRECISION
The target type can have precision.
|
static String |
ME_PARAM_TABLE
Name of the parameter to indicate (via the 'param' attribute) that the
type of a map entry is represented by a table.
|
static String |
ME_PARAM_TABLE_CHARACT_REP_CAT
A characteristic for the parameter "table" that gives
information about the category of the conceptual type that is identified
by the map entry.
|
static String |
ME_PARAM_TABLE_CHARACT_REP_CAT_VALIDATION_REGEX
Regular expression to check that a given string is one of a list of
allowed values (NOTE: check is case-insensitive).
|
static String |
ME_PARAM_TEXTORCHARACTERVARYING |
static String |
NOT_NULL_COLUMN_SPEC |
static String |
PARAM_CODE_NAME_COLUMN_DOCUMENTATION |
static String |
PARAM_CODE_NAME_COLUMN_NAME
This parameter controls the name of the column that contains the name or
- if available - the initial value of a code.
|
static String |
PARAM_CODE_NAME_SIZE |
static String |
PARAM_CODESTATUS_CL_COLUMN_DOCUMENTATION |
static String |
PARAM_CODESTATUS_NOTES_COLUMN_DOCUMENTATION |
static String |
PARAM_CODESTATUSCL_LENGTH
Specify the length of an codeStatusCL column added by
"rule-sql-cls-code-lists-pods", in case that the code status
type is an enumeration.
|
static String |
PARAM_CODESTATUSCL_TYPE
Specify the conceptual type that applies to the codeStatusCL column added
by "rule-sql-cls-code-lists-pods".
|
static String |
PARAM_CREATE_DOCUMENTATION
Flag to indicate that model documentation shall be added to the DDL via
comments; default is true.
|
static String |
PARAM_CREATE_REFERENCES
Flag to indicate that foreign key creation is desired (true); default is
false.
|
static String |
PARAM_DATABASE_SYSTEM
Identifier of the database system for which SQL DDL shall be created.
|
static String |
PARAM_DESCRIPTORS_FOR_CODELIST
Comma-separated list of descriptors that shall be encoded as individual
columns in a table representing a code list.
|
static String |
PARAM_DOCUMENTATION_NOVALUE |
static String |
PARAM_DOCUMENTATION_TEMPLATE
Optional changes to the default documentation template and the default
strings for descriptors without value
|
static String |
PARAM_FILE_DDL_BOTTOM
Absolute or relative path to the text file (character encoding is assumed
to be UTF-8) whose contents shall be added at the bottom of DDL files
produced by the target.
|
static String |
PARAM_FILE_DDL_TOP
Absolute or relative path to the text file (character encoding is assumed
to be UTF-8) whose contents shall be added at the top of DDL files
produced by the target.
|
static String |
PARAM_FOREIGN_KEY_COLUMN_DATA_TYPE
Datatype to use for foreign key fields, for example 'bigint' in case of a
PostgreSQL database.
|
static String |
PARAM_FOREIGN_KEY_COLUMN_SUFFIX
Suffix to append to the name of columns that contain foreign keys (except
if it references a table that represents a data type).
|
static String |
PARAM_FOREIGN_KEY_COLUMN_SUFFIX_CODELIST
Suffix to append to the name of columns that contain foreign keys
referencing tables that represent code lists.
|
static String |
PARAM_FOREIGN_KEY_COLUMN_SUFFIX_DATATYPE
Suffix to append to the name of columns that contain foreign keys
referencing tables that represent data types.
|
static String |
PARAM_ID_COLUMN_NAME
Name for the identifier column when generating table creation statements.
|
static String |
PARAM_NAME_CODESTATUS_CL_COLUMN
Define the name for the column that stores the value of the code status
code list.
|
static String |
PARAM_NAME_CODESTATUSNOTES_COLUMN
Define the name for the column that stores a note on the code status.
|
static String |
PARAM_ONE_TO_MANY_REF_COLUMN_NAME
Defines the first part of the name of the column in a data type table
that is used to reference tables that represent types from the conceptual
model which have a one to many relationship with the data type.
|
static String |
PARAM_PRIMARYKEY_SPEC
Specification for the primary key of a 'normal' table (neither an
associative table nor representing a code list).
|
static String |
PARAM_PRIMARYKEY_SPEC_CODELIST
Specification for the primary key of a code list table.
|
static String |
PARAM_REMOVE_EMPTY_LINES_IN_DDL_OUTPUT
Set to
true if empty lines should be removed in SQL DDL
files created by the target. |
static String |
PARAM_SDO_DIM_ELEMENTS
NOTE: This parameter applies to the Oracle database system only.
|
static String |
PARAM_SEPARATE_CODE_INSERT_STATEMENTS_BY_CODELIST_TYPE
If this parameter is included in the configuration, then SQL statements
for insertion of codes into codelist tables are written to separate
output files.
|
static String |
PARAM_SEPARATE_SPATIAL_INDEX_STATEMENTS
If the value of this parameter is 'true' (ignoring case), then SQL
statements related to spatial indexes (creation, but also insertion of
geometry metadata) are written to a separate output file.
|
static String |
PARAM_SIZE
Size for fields representing textual properties with limited length, to
be used in case that the property represented by the field does not have
a 'size' tagged value; default is 1024
|
static String |
PARAM_SRID
EPSG code of the spatial reference system to use for geometries; default
is 4326
|
static Pattern |
PATTERN_ME_TARGETTYPE_LENGTH_PRECISION_SCALE
Regular expression to extract the data type name as well as length,
precision and scale from the target type defined by a map entry.
|
static String |
PATTERN_SDO_DIM_ELEMENTS
Regular expression to validate the value of parameter
"sdoDimElements":
(\([^,]+(,[-]?
|
static String |
RULE_TGT_SQL_ALL_ASSOCIATIVETABLES
This rule ensures that associative tables are created for cases in which
an n:m relationship exists between types.
|
static String |
RULE_TGT_SQL_ALL_CHECK_CONSTRAINT_NAMING_ORACLE_DEFAULT |
static String |
RULE_TGT_SQL_ALL_CHECK_CONSTRAINT_NAMING_PEARSONHASH |
static String |
RULE_TGT_SQL_ALL_CHECK_CONSTRAINT_NAMING_POSTGRESQL_DEFAULT |
static String |
RULE_TGT_SQL_ALL_CHECK_CONSTRAINT_NAMING_SQLSERVER_DEFAULT |
static String |
RULE_TGT_SQL_ALL_DOCUMENTATION_EXPLICIT_COMMENTS
Creates COMMENT statements to document tables and columns that represent
application schema elements.
|
static String |
RULE_TGT_SQL_ALL_EXCLUDE_ABSTRACT
If this rule is enabled, abstract classes will be ignored by the target.
|
static String |
RULE_TGT_SQL_ALL_FOREIGNKEY_ORACLE_NAMING_STYLE
Under this rule, foreign key identifiers are generated as follows:
"fk_" + tableNameForFK + "" + targetTableNameForFK + "" + fieldNameForFK
+ count where:
tableNameForFK is the name of the table that contains the field with
the foreign key, clipped to the first eight characters
targetTableNameForFK is the name of the table that the field with
foreign key references, clipped to the first eight characters
fieldNameForFK is the name of the field that contains the foreign
key, clipped to the first eight characters
count is the number of times the foreign key identifier has been
assigned; it ranges from 0-9 and can also be omitted, thus supporting
eleven unambiguous uses of the foreign key identifier (NOTE: if the
foreign key identifier is used more than eleven times, ShapeChange logs a
warning)
|
static String |
RULE_TGT_SQL_ALL_FOREIGNKEY_PEARSONHASH_NAMING
Under this rule, foreign key identifiers are generated as follows:
"fk_" + tableName + "_" + targetTableName + "_" + fieldName + pearsonHash
where:
tableName is the name of the table that contains the field with the
foreign key, clipped to the first seven characters
targetTableName is the name of the table that the field with foreign
key references, clipped to the first seven characters
fieldName is the name of the field that contains the foreign key,
clipped to the first seven characters
pearsonHash is the pearson hash (see
https://en.wikipedia.org/wiki/Pearson_hashing and the original paper:
Pearson, Peter K.
|
static String |
RULE_TGT_SQL_ALL_NORMALIZING_IGNORE_CASE
If this rule is included, case is not changed when normalizing names,
regardless of the rule for normalizing names.
|
static String |
RULE_TGT_SQL_ALL_NORMALIZING_LOWER_CASE |
static String |
RULE_TGT_SQL_ALL_NORMALIZING_ORACLE |
static String |
RULE_TGT_SQL_ALL_NORMALIZING_SQLSERVER |
static String |
RULE_TGT_SQL_ALL_NORMALIZING_UPPER_CASE |
static String |
RULE_TGT_SQL_ALL_NOTENCODED |
static String |
RULE_TGT_SQL_ALL_PRECISION_AND_SCALE
For properties or numerically valued code lists with tagged value
'precision' and 'scale' (both with integer value), an according suffix is
added to the datatype declaration, resulting in, for example,
'number(5,2)' instead of just 'number'.
|
static String |
RULE_TGT_SQL_ALL_SUPPRESS_INLINE_DOCUMENTATION
Prevents creation of documentation of schema elements via inline
comments.
|
static String |
RULE_TGT_SQL_CLS_CODELISTS
Tables are generated for code lists.
|
static String |
RULE_TGT_SQL_CLS_CODELISTS_PODS |
static String |
RULE_TGT_SQL_CLS_DATATYPES
Ensures that table creation statements are generated for complex data
types.
|
static String |
RULE_TGT_SQL_CLS_DATATYPES_ONETOMANY_ONETABLE
Specific implementation of a one to many relationship to a data type: the
table that represents the data type contains an additional column that
references other tables (which represent classes that have a one-to-many
relationship with the data type).
|
static String |
RULE_TGT_SQL_CLS_DATATYPES_ONETOMANY_ONETABLE_IGNORE_SINGLE_VALUED_CASE
Extends "rule-sql-cls-data-types-oneToMany-oneTable" to
prevent creation of a field for an attribute with a data type - for which
a table is created - as type, when the attribute has max cardinality 1.
|
static String |
RULE_TGT_SQL_CLS_DATATYPES_ONETOMANY_SEVERALTABLES
Specific implementation of a one to many relationship between a type A
and a data type B: for each such relationship, a new table is created for
the data type (as defined by "rule-sql-cls-data-types".
|
static String |
RULE_TGT_SQL_CLS_DATATYPES_ONETOMANY_SEVERALTABLES_AVOID_TABLE_FOR_DATATYPE_IF_UNUSED
Extends "rule-sql-cls-data-types-oneToMany-severalTables" to
avoid the creation of the general table for a data type, if that table is
not used.
|
static String |
RULE_TGT_SQL_CLS_FEATURE_TYPES
Ensures that table creation statements are generated for feature types.
|
static String |
RULE_TGT_SQL_CLS_IDENTIFIER_STEREOTYPE
Enables use of stereotype 'identifier' on class attributes.
|
static String |
RULE_TGT_SQL_CLS_OBJECT_TYPES
Ensures that table creation statements are generated for object types.
|
static String |
RULE_TGT_SQL_CLS_REFERENCES_TO_EXTERNAL_TYPES
If this rule is enabled, then a property whose type is neither covered by
a type mapping entry nor contained in the currently processed schema -
but in the overall model - is still encoded as a field with a foreign key
- if other rules allow table creation for this type.
|
static String |
RULE_TGT_SQL_PROP_CHECK_CONSTRAINT_RESTRICT_TIME_OF_DATE
NOTE: currently only applicable when deriving DDL for the Oracle database
system.
|
static String |
RULE_TGT_SQL_PROP_CHECK_CONSTRAINTS_FOR_ENUMERATIONS
Ensures that CHECK constraints are created for fields representing
enumeration values.
|
static String |
RULE_TGT_SQL_PROP_EXCLUDE_DERIVED
If this rule is enabled derived properties will be ignored.
|
static String |
RULE_TGT_SQL_PROP_UNIQUE_CONSTRAINTS
Unique constraints are created for fields representing a property with
tagged value 'sqlUnique' = true.
|
static String |
TV_ASSOCIATIVETABLE |
static String |
TV_NUMERIC_TYPE
Setting this tagged value on a code list indicates that the codes are
numeric.
|
static String |
TV_ONE_TO_MANY_REF_COLUMN_NAME
Name of the tagged value that overwrites the value of configuration
parameter "oneToManyReferenceColumnName" for a given
datatype.
|
Constructor and Description |
---|
SqlConstants() |
public static final String PARAM_REMOVE_EMPTY_LINES_IN_DDL_OUTPUT
true
if empty lines should be removed in SQL DDL
files created by the target. Some SQL clients choke on such lines.
Default is false
.public static final String PARAM_FILE_DDL_TOP
public static final String PARAM_FILE_DDL_BOTTOM
public static final String PARAM_ID_COLUMN_NAME
public static final String PARAM_PRIMARYKEY_SPEC
public static final String PARAM_PRIMARYKEY_SPEC_CODELIST
public static final String PARAM_FOREIGN_KEY_COLUMN_SUFFIX
public static final String PARAM_FOREIGN_KEY_COLUMN_SUFFIX_CODELIST
public static final String PARAM_FOREIGN_KEY_COLUMN_SUFFIX_DATATYPE
public static final String PARAM_FOREIGN_KEY_COLUMN_DATA_TYPE
public static final String PARAM_SDO_DIM_ELEMENTS
public static final String PARAM_SEPARATE_SPATIAL_INDEX_STATEMENTS
public static final String PARAM_SEPARATE_CODE_INSERT_STATEMENTS_BY_CODELIST_TYPE
public static final String PATTERN_SDO_DIM_ELEMENTS
public static final String PARAM_SIZE
public static final String PARAM_SRID
public static final String PARAM_CREATE_REFERENCES
public static final String PARAM_CREATE_DOCUMENTATION
public static final String PARAM_DATABASE_SYSTEM
public static final String PARAM_DOCUMENTATION_TEMPLATE
public static final String PARAM_DOCUMENTATION_NOVALUE
public static final String PARAM_DESCRIPTORS_FOR_CODELIST
Applies to "rule-sql-cls-code-lists"
public static final String PARAM_CODESTATUSCL_TYPE
public static final String PARAM_CODESTATUSCL_LENGTH
public static final String PARAM_CODE_NAME_COLUMN_NAME
Additional columns can be defined via the configuration parameter "descriptorsForCodelist".
Applies to "rule-sql-cls-code-lists"
public static final String PARAM_CODE_NAME_COLUMN_DOCUMENTATION
public static final String PARAM_CODE_NAME_SIZE
public static final String PARAM_ONE_TO_MANY_REF_COLUMN_NAME
public static final String DEFAULT_ONE_TO_MANY_REF_COLUMN_NAME
public static final String PARAM_NAME_CODESTATUS_CL_COLUMN
public static final String DEFAULT_NAME_CODESTATUS_CL_COLUMN
public static final String PARAM_CODESTATUS_CL_COLUMN_DOCUMENTATION
public static final String PARAM_NAME_CODESTATUSNOTES_COLUMN
public static final String DEFAULT_NAME_CODESTATUSNOTES_COLUMN
public static final String PARAM_CODESTATUS_NOTES_COLUMN_DOCUMENTATION
public static final String RULE_TGT_SQL_CLS_FEATURE_TYPES
public static final String RULE_TGT_SQL_CLS_OBJECT_TYPES
public static final String RULE_TGT_SQL_PROP_CHECK_CONSTRAINTS_FOR_ENUMERATIONS
public static final String RULE_TGT_SQL_PROP_UNIQUE_CONSTRAINTS
public static final String RULE_TGT_SQL_PROP_CHECK_CONSTRAINT_RESTRICT_TIME_OF_DATE
public static final String RULE_TGT_SQL_CLS_DATATYPES
public static final String RULE_TGT_SQL_CLS_DATATYPES_ONETOMANY_ONETABLE
public static final String RULE_TGT_SQL_CLS_DATATYPES_ONETOMANY_ONETABLE_IGNORE_SINGLE_VALUED_CASE
public static final String RULE_TGT_SQL_CLS_DATATYPES_ONETOMANY_SEVERALTABLES
NOTE: This rule has higher priority than "rule-sql-cls-data-types-oneToMany-oneTable".
public static final String RULE_TGT_SQL_CLS_DATATYPES_ONETOMANY_SEVERALTABLES_AVOID_TABLE_FOR_DATATYPE_IF_UNUSED
public static final String RULE_TGT_SQL_CLS_CODELISTS
public static final String RULE_TGT_SQL_CLS_IDENTIFIER_STEREOTYPE
public static final String RULE_TGT_SQL_CLS_CODELISTS_PODS
public static final String RULE_TGT_SQL_CLS_REFERENCES_TO_EXTERNAL_TYPES
public static final String RULE_TGT_SQL_ALL_ASSOCIATIVETABLES
public static final String RULE_TGT_SQL_PROP_EXCLUDE_DERIVED
public static final String RULE_TGT_SQL_ALL_PRECISION_AND_SCALE
public static final String RULE_TGT_SQL_ALL_EXCLUDE_ABSTRACT
public static final String RULE_TGT_SQL_ALL_NOTENCODED
public static final String RULE_TGT_SQL_ALL_FOREIGNKEY_ORACLE_NAMING_STYLE
"fk_" + tableNameForFK + "" + targetTableNameForFK + "" + fieldNameForFK + count where:
public static final String RULE_TGT_SQL_ALL_FOREIGNKEY_PEARSONHASH_NAMING
"fk_" + tableName + "_" + targetTableName + "_" + fieldName + pearsonHash
where:
public static final String RULE_TGT_SQL_ALL_CHECK_CONSTRAINT_NAMING_ORACLE_DEFAULT
public static final String RULE_TGT_SQL_ALL_CHECK_CONSTRAINT_NAMING_POSTGRESQL_DEFAULT
public static final String RULE_TGT_SQL_ALL_CHECK_CONSTRAINT_NAMING_SQLSERVER_DEFAULT
public static final String RULE_TGT_SQL_ALL_CHECK_CONSTRAINT_NAMING_PEARSONHASH
public static final String RULE_TGT_SQL_ALL_NORMALIZING_IGNORE_CASE
public static final String RULE_TGT_SQL_ALL_NORMALIZING_LOWER_CASE
public static final String RULE_TGT_SQL_ALL_NORMALIZING_UPPER_CASE
public static final String RULE_TGT_SQL_ALL_NORMALIZING_SQLSERVER
public static final String RULE_TGT_SQL_ALL_NORMALIZING_ORACLE
public static final String RULE_TGT_SQL_ALL_SUPPRESS_INLINE_DOCUMENTATION
public static final String RULE_TGT_SQL_ALL_DOCUMENTATION_EXPLICIT_COMMENTS
public static final String TV_ASSOCIATIVETABLE
public static final String TV_ONE_TO_MANY_REF_COLUMN_NAME
public static final String TV_NUMERIC_TYPE
public static final String DESCRIPTORS_FOR_CODELIST_REGEX
(name|documentation|alias|definition|description|example|legalBasis|dataCaptureStatement|primaryCode)(\(((columnName|size|columnDocumentation)=([^,;\)]|(?<=\\)[,;\)])+)(;(columnName|size|columnDocumentation)=([^,;\)]|(?<=\\)[,;\)])+)*\))?
public static final String DEFAULT_CODESTATUSCL_TYPE
public static final int DEFAULT_CODESTATUSCL_LENGTH
public static final String DEFAULT_CODE_NAME_COLUMN_NAME
public static final String DEFAULT_ID_COLUMN_NAME
public static final String DEFAULT_FOREIGN_KEY_COLUMN_SUFFIX
public static final String DEFAULT_FOREIGN_KEY_COLUMN_SUFFIX_DATATYPE
public static final String DEFAULT_PRIMARYKEY_SPEC
public static final String DEFAULT_PRIMARYKEY_SPEC_CODELIST
public static final int DEFAULT_SIZE
public static final int DEFAULT_CODE_NAME_SIZE
public static final int DEFAULT_SRID
public static final boolean DEFAULT_CREATE_REFERNCES
public static final boolean DEFAULT_CREATE_DOCUMENTATION
public static final String ME_PARAM_DEFAULTVALUE
public static final String ME_PARAM_DEFAULTVALUE_CHARACT_TRUE
public static final String ME_PARAM_DEFAULTVALUE_CHARACT_FALSE
public static final String ME_PARAM_DEFAULTVALUE_CHARACT_QUOTED
public static final String ME_PARAM_GEOMETRY
public static final String ME_PARAM_TABLE
public static final String ME_PARAM_TABLE_CHARACT_REP_CAT
public static final String ME_PARAM_TABLE_CHARACT_REP_CAT_VALIDATION_REGEX
public static final String ME_PARAM_TEXTORCHARACTERVARYING
public static final String ME_PARAM_LENGTH
public static final String ME_PARAM_PRECISION
public static final String MAP_TARGETTYPE_COND_PART
public static final String MAP_TARGETTYPE_COND_TEXTORCHARACTERVARYING
public static final String CRLF
public static final String INDENT
public static final String NOT_NULL_COLUMN_SPEC
public static final Pattern PATTERN_ME_TARGETTYPE_LENGTH_PRECISION_SCALE
null
).Copyright © 2018. All rights reserved.