Class H2Dialect

java.lang.Object
org.umlg.sqlg.sql.dialect.BaseSqlDialect
org.umlg.sqlg.dialect.impl.H2Dialect
All Implemented Interfaces:
SqlBulkDialect, SqlDialect, SqlSchemaChangeDialect

public class H2Dialect extends BaseSqlDialect
Since:
1.3.0
Author:
Lukas Krejci
  • Constructor Details

    • H2Dialect

      public H2Dialect()
  • Method Details

    • supportsCascade

      public boolean supportsCascade()
    • isH2

      public boolean isH2()
    • supportsBatchMode

      public boolean supportsBatchMode()
    • dialectName

      public String dialectName()
    • needsSchemaDropCascade

      public boolean needsSchemaDropCascade()
    • getInternalSchemas

      public Set<String> getInternalSchemas()
    • createSchemaStatement

      public String createSchemaStatement(String schemaName)
    • sqlTypeToPropertyType

      public PropertyType sqlTypeToPropertyType(SqlgGraph sqlgGraph, String schema, String table, String column, int sqlType, String typeName, ListIterator<org.apache.commons.lang3.tuple.Triple<String,Integer,String>> metaDataIter)
    • sqlArrayTypeNameToPropertyType

      public PropertyType sqlArrayTypeNameToPropertyType(String typeName, SqlgGraph sqlgGraph, String schema, String table, String columnName, ListIterator<org.apache.commons.lang3.tuple.Triple<String,Integer,String>> metaDataIter)
      All this is because H2 does not return the TYPE_NAME for column meta data. The strategy is to actualy query the table get the column's value and interrogate it to get its type. If the column has no data then we are stuffed and an exception is thrown.
      Parameters:
      typeName -
      sqlgGraph -
      schema -
      table -
      columnName -
      metaDataIter -
      Returns:
    • validateProperty

      public void validateProperty(Object key, Object value)
    • getColumnEscapeKey

      public String getColumnEscapeKey()
    • getPrimaryKeyType

      public String getPrimaryKeyType()
    • getAutoIncrementPrimaryKeyConstruct

      public String getAutoIncrementPrimaryKeyConstruct()
    • propertyTypeToSqlDefinition

      public String[] propertyTypeToSqlDefinition(PropertyType propertyType)
    • propertyTypeToJavaSqlType

      public int[] propertyTypeToJavaSqlType(PropertyType propertyType)
    • getForeignKeyTypeDefinition

      public String getForeignKeyTypeDefinition()
    • getArrayDriverType

      public String getArrayDriverType(PropertyType arrayType)
    • putJsonObject

      public void putJsonObject(com.fasterxml.jackson.databind.node.ObjectNode obj, String columnName, int sqlType, Object o)
    • putJsonMetaObject

      public void putJsonMetaObject(com.fasterxml.jackson.databind.ObjectMapper mapper, com.fasterxml.jackson.databind.node.ArrayNode metaNodeArray, String columnName, int sqlType, Object o)
    • existIndexQuery

      public String existIndexQuery(SchemaTable schemaTable, String prefix, String indexName)
    • getSpacialRefTable

      public Set<String> getSpacialRefTable()
    • getGisSchemas

      public List<String> getGisSchemas()
    • setPoint

      public void setPoint(PreparedStatement preparedStatement, int parameterStartIndex, Object point)
    • setLineString

      public void setLineString(PreparedStatement preparedStatement, int parameterStartIndex, Object lineString)
    • setPolygon

      public void setPolygon(PreparedStatement preparedStatement, int parameterStartIndex, Object point)
    • setGeographyPoint

      public void setGeographyPoint(PreparedStatement preparedStatement, int parameterStartIndex, Object point)
    • getGis

      public <T> T getGis(SqlgGraph sqlgGraph)
    • lockTable

      public void lockTable(SqlgGraph sqlgGraph, SchemaTable schemaTable, String prefix)
    • alterSequenceCacheSize

      public void alterSequenceCacheSize(SqlgGraph sqlgGraph, SchemaTable schemaTable, String sequence, int batchSize)
    • nextSequenceVal

      public long nextSequenceVal(SqlgGraph sqlgGraph, SchemaTable schemaTable, String prefix)
    • currSequenceVal

      public long currSequenceVal(SqlgGraph sqlgGraph, SchemaTable schemaTable, String prefix)
    • sequenceName

      public String sequenceName(SqlgGraph sqlgGraph, SchemaTable outSchemaTable, String prefix)
    • supportsBulkWithinOut

      public boolean supportsBulkWithinOut()
    • supportsTransactionalSchema

      public boolean supportsTransactionalSchema()
    • afterCreateTemporaryTableStatement

      public String afterCreateTemporaryTableStatement()
    • sqlgTopologyCreationScripts

      public List<String> sqlgTopologyCreationScripts()
    • sqlgCreateTopologyGraph

      public String sqlgCreateTopologyGraph()
    • sqlgAddIndexEdgeSequenceColumn

      public String sqlgAddIndexEdgeSequenceColumn()
    • convertArray

      public Object convertArray(PropertyType propertyType, Array array) throws SQLException
      Throws:
      SQLException
    • setArray

      public void setArray(PreparedStatement statement, int index, PropertyType type, Object[] values) throws SQLException
      Throws:
      SQLException
    • getPublicSchema

      public String getPublicSchema()
    • isSystemIndex

      public boolean isSystemIndex(String indexName)
    • supportsFullValueExpression

      public boolean supportsFullValueExpression()
    • valueToValuesString

      public String valueToValuesString(PropertyType propertyType, Object value)
    • supportsType

      public boolean supportsType(PropertyType propertyType)
    • supportsJsonArrayValues

      public boolean supportsJsonArrayValues()
    • sqlToTurnOffReferentialConstraintCheck

      public String sqlToTurnOffReferentialConstraintCheck(String tableName)
    • sqlToTurnOnReferentialConstraintCheck

      public String sqlToTurnOnReferentialConstraintCheck(String tableName)
    • addPartitionTables

      public List<String> addPartitionTables()
    • addHashPartitionColumns

      public List<String> addHashPartitionColumns()
    • addDbVersionToGraph

      public String addDbVersionToGraph(DatabaseMetaData metadata)
    • grantReadOnlyUserPrivilegesToSqlgSchemas

      public void grantReadOnlyUserPrivilegesToSqlgSchemas(SqlgGraph sqlgGraph)
    • toSelectString

      public String toSelectString(boolean partOfDuplicateQuery, ColumnList.Column column, String alias)
    • isTimestampz

      public boolean isTimestampz(String typeName)
    • addPropertyDefinitions

      public List<String> addPropertyDefinitions()
    • addOutEdgeDefinitions

      public List<String> addOutEdgeDefinitions()
    • addInEdgeDefinitions

      public List<String> addInEdgeDefinitions()
    • checkConstraintName

      public String checkConstraintName(SqlgGraph sqlgGraph, String schema, String table, String column, String constraint)