org.h2.engine

## Class Mode

- java.lang.Object
- - org.h2.engine.Mode

    public class Mode
    extends java.lang.Object

The compatibility modes. There is a fixed set of modes (for example PostgreSQL, MySQL). Each mode has different settings.

### Nested Class Summary

Nested Classes
`static class` `Mode.ModeEnum`
`static class` `Mode.UniqueIndexNullsHandling` Determines how rows with `NULL` values in indexed columns are handled in unique indexes.

### Field Summary

Fields
`boolean` `aliasColumnName` When enabled, aliased columns (as in SELECT ID AS I FROM TEST) return the alias (I in this case) in ResultSetMetaData.getColumnName() and 'null' in getTableName().
`boolean` `allowAffinityKey` Whether AFFINITY KEY keywords are supported.
`boolean` `allowDB2TimestampFormat` Whether DB2 TIMESTAMP formats are allowed.
`boolean` `allowPlusForStringConcat` Text can be concatenated using '+'.
`boolean` `convertInsertNullToZero` When inserting data, if a column is defined to be NOT NULL and NULL is inserted, then a 0 (or empty string, or the current timestamp for timestamp columns) value is used.
`boolean` `convertOnlyToSmallerScale` When converting the scale of decimal data, the number is only converted if the new scale is smaller than the current scale.
`java.util.Set<java.lang.String>` `disallowedTypes` An optional Set of hidden/disallowed column types.
`boolean` `indexDefinitionInCreateTable` Creating indexes in the CREATE TABLE statement is allowed using `INDEX(..)` or `KEY(..)`.
`boolean` `isolationLevelInSelectOrInsertStatement` can set the isolation level using WITH {RR|RS|CS|UR}
`boolean` `logIsLogBase10` The function LOG() uses base 10 instead of E.
`boolean` `lowerCaseIdentifiers` Meta data calls return identifiers in lower case.
`boolean` `nullConcatIsNull` Concatenation with NULL results in NULL.
`boolean` `onDuplicateKeyUpdate` MySQL style INSERT ...
`boolean` `padFixedLengthStrings` Whether to right-pad fixed strings with spaces.
`boolean` `prohibitEmptyInPredicate` Whether an empty list as in "NAME IN()" results in a syntax error.
`boolean` `regexpReplaceBackslashReferences` The function REGEXP_REPLACE() uses \ for back-references.
`boolean` `serialColumnIsNotPK` SERIAL and BIGSERIAL columns are not automatically primary keys.
`boolean` `squareBracketQuotedNames` Identifiers may be quoted using square brackets as in [Test].
`java.util.regex.Pattern` `supportedClientInfoPropertiesRegEx` Pattern describing the keys the java.sql.Connection.setClientInfo() method accepts.
`boolean` `supportPoundSymbolForColumnNames` Support the # for column names
`boolean` `swapConvertFunctionParameters` Swap the parameters of the CONVERT function.
`boolean` `sysDummy1` Support the pseudo-table SYSIBM.SYSDUMMY1.
`boolean` `systemColumns` The system columns 'CTID' and 'OID' are supported.
`boolean` `treatEmptyStringsAsNull` Empty strings are treated like NULL values.
`java.util.HashMap<java.lang.String,DataType>` `typeByNameMap` Custom mappings from type names to data types.
`Mode.UniqueIndexNullsHandling` `uniqueIndexNullsHandling` Determines how rows with `NULL` values in indexed columns are handled in unique indexes.

### Method Summary

Methods
`Mode.ModeEnum` `getEnum()`
`static Mode` `getInstance(java.lang.String name)` Get the mode with the given name.
`java.lang.String` `getName()`
`static Mode` `getRegular()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### aliasColumnName

    public boolean aliasColumnName

When enabled, aliased columns (as in SELECT ID AS I FROM TEST) return the alias (I in this case) in ResultSetMetaData.getColumnName() and 'null' in getTableName(). If disabled, the real column name (ID in this case) and table name is returned.

#### convertInsertNullToZero

    public boolean convertInsertNullToZero

When inserting data, if a column is defined to be NOT NULL and NULL is inserted, then a 0 (or empty string, or the current timestamp for timestamp columns) value is used. Usually, this operation is not allowed and an exception is thrown.

#### convertOnlyToSmallerScale

    public boolean convertOnlyToSmallerScale

When converting the scale of decimal data, the number is only converted if the new scale is smaller than the current scale. Usually, the scale is converted and 0s are added if required.

#### indexDefinitionInCreateTable

    public boolean indexDefinitionInCreateTable

Creating indexes in the CREATE TABLE statement is allowed using `INDEX(..)` or `KEY(..)`. Example: `create table test(id int primary key, name varchar(255), key idx_name(name));`

#### lowerCaseIdentifiers

    public boolean lowerCaseIdentifiers

Meta data calls return identifiers in lower case.

#### nullConcatIsNull

    public boolean nullConcatIsNull

Concatenation with NULL results in NULL. Usually, NULL is treated as an empty string if only one of the operands is NULL, and NULL is only returned if both operands are NULL.

#### squareBracketQuotedNames

    public boolean squareBracketQuotedNames

Identifiers may be quoted using square brackets as in [Test].

#### systemColumns

    public boolean systemColumns

The system columns 'CTID' and 'OID' are supported.

#### uniqueIndexNullsHandling

    public Mode.UniqueIndexNullsHandling uniqueIndexNullsHandling

Determines how rows with `NULL` values in indexed columns are handled in unique indexes.

#### treatEmptyStringsAsNull

    public boolean treatEmptyStringsAsNull

Empty strings are treated like NULL values. Useful for Oracle emulation.

#### sysDummy1

    public boolean sysDummy1

Support the pseudo-table SYSIBM.SYSDUMMY1.

#### allowPlusForStringConcat

    public boolean allowPlusForStringConcat

Text can be concatenated using '+'.

#### logIsLogBase10

    public boolean logIsLogBase10

The function LOG() uses base 10 instead of E.

#### regexpReplaceBackslashReferences

    public boolean regexpReplaceBackslashReferences

The function REGEXP_REPLACE() uses \ for back-references.

#### serialColumnIsNotPK

    public boolean serialColumnIsNotPK

SERIAL and BIGSERIAL columns are not automatically primary keys.

#### swapConvertFunctionParameters

    public boolean swapConvertFunctionParameters

Swap the parameters of the CONVERT function.

#### isolationLevelInSelectOrInsertStatement

    public boolean isolationLevelInSelectOrInsertStatement

can set the isolation level using WITH {RR|RS|CS|UR}

#### onDuplicateKeyUpdate

    public boolean onDuplicateKeyUpdate

MySQL style INSERT ... ON DUPLICATE KEY UPDATE ... and INSERT IGNORE

#### supportedClientInfoPropertiesRegEx

    public java.util.regex.Pattern supportedClientInfoPropertiesRegEx

Pattern describing the keys the java.sql.Connection.setClientInfo() method accepts.

#### supportPoundSymbolForColumnNames

    public boolean supportPoundSymbolForColumnNames

Support the # for column names

#### prohibitEmptyInPredicate

    public boolean prohibitEmptyInPredicate

Whether an empty list as in "NAME IN()" results in a syntax error.

#### allowAffinityKey

    public boolean allowAffinityKey

Whether AFFINITY KEY keywords are supported.

#### padFixedLengthStrings

    public boolean padFixedLengthStrings

Whether to right-pad fixed strings with spaces.

#### allowDB2TimestampFormat

    public boolean allowDB2TimestampFormat

Whether DB2 TIMESTAMP formats are allowed.

#### disallowedTypes

    public java.util.Set<java.lang.String> disallowedTypes

An optional Set of hidden/disallowed column types. Certain DBMSs don't support all column types provided by H2, such as "NUMBER" when using PostgreSQL mode.

#### typeByNameMap

    public java.util.HashMap<java.lang.String,DataType> typeByNameMap

Custom mappings from type names to data types.

### Method Detail

#### getInstance

    public static Mode getInstance(java.lang.String name)

Get the mode with the given name.

Parameters:
  `name` - the name of the mode
Returns:
  the mode object

#### getRegular

    public static Mode getRegular()

#### getName

    public java.lang.String getName()

#### getEnum

    public Mode.ModeEnum getEnum()