Package org.umlg.sqlg.sql.dialect
Class BaseSqlDialect
java.lang.Object
org.umlg.sqlg.sql.dialect.BaseSqlDialect
- All Implemented Interfaces:
 SqlBulkDialect,SqlDialect,SqlSchemaChangeDialect
public abstract class BaseSqlDialect
extends Object
implements SqlDialect, SqlBulkDialect, SqlSchemaChangeDialect
Date: 2014/08/21
 Time: 6:52 PM
- 
Field Summary
FieldsFields inherited from interface org.umlg.sqlg.sql.dialect.SqlDialect
INDEX_POSTFIX - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected Stringescape quotes by doubling them when we need a string inside quotesvoidflushEdgeCache(SqlgGraph sqlgGraph, Map<MetaEdge, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgEdge, org.apache.commons.lang3.tuple.Triple<SqlgVertex, SqlgVertex, Map<String, Object>>>>> edgeCache) voidflushEdgePropertyCache(SqlgGraph sqlgGraph, Map<SchemaTable, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgEdge, Map<String, Object>>>> edgePropertyCache) voidflushRemovedEdges(SqlgGraph sqlgGraph, Map<SchemaTable, List<SqlgEdge>> removeEdgeCache) voidflushRemovedVertices(SqlgGraph sqlgGraph, Map<SchemaTable, List<SqlgVertex>> removeVertexCache) voidflushVertexCache(SqlgGraph sqlgGraph, Map<SchemaTable, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>>> vertexCache) voidflushVertexPropertyCache(SqlgGraph sqlgGraph, Map<SchemaTable, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>>> vertexPropertyCache) getEdgeTables(DatabaseMetaData metaData) Get all the Edge tables.getIndexInfo(DatabaseMetaData metaData, String catalog, String schema, String table, boolean unique, boolean approximate) getPrimaryKeys(DatabaseMetaData metaData, String catalog, String schemaPattern, String tableNamePattern) Return the table's primary keys.getSchemaNames(DatabaseMetaData metaData) Returns all schemas.getTableColumns(DatabaseMetaData metaData, String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) Get the columns for a table.getVertexTables(DatabaseMetaData metaData) Get all the Vertex tables.voidhandleOther(Map<String, Object> properties, String columnName, Object o, PropertyType propertyType) voidsetJson(PreparedStatement preparedStatement, int parameterStartIndex, com.fasterxml.jackson.databind.JsonNode right) intReturns the number of parameters that can be passed into a sql 'IN' statement.voidvalidateColumnName(String column) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.umlg.sqlg.sql.dialect.SqlBulkDialect
bulkAddEdges, constructCompleteCopyCommandSqlEdge, constructCompleteCopyCommandSqlVertex, constructCompleteCopyCommandSqlVertex, constructCompleteCopyCommandTemporarySqlVertex, getBatchNull, streamSql, temporaryTableCopyCommandSqlVertex, writeStreamingEdge, writeStreamingVertex, writeTemporaryStreamingVertexMethods inherited from interface org.umlg.sqlg.sql.dialect.SqlDialect
addColumnStatement, addDbVersionToGraph, addHashPartitionColumns, addInEdgeDefinitions, addNotNullConstraint, addOutEdgeDefinitions, addPartitionSchemaAbstractLabelColumns, addPartitionTables, addPropertyDefinitions, afterCreateTemporaryTableStatement, alterForeignKeyToDeferrable, alterSequenceCacheSize, assertTableName, canUserCreateSchemas, checkConstraintName, columnsToIgnore, convertArray, createSchemaStatement, createTableStatement, createTemporaryTableStatement, currSequenceVal, dialectName, drop, drop, drop, dropIndex, dropSchemaStatement, dropWithForeignKey, existIndexQuery, extractIndices, getArrayContainsQueryText, getArrayDriverType, getArrayOverlapsQueryText, getAutoIncrement, getAutoIncrementPrimaryKeyConstruct, getBlocked, getColumnEscapeKey, getConnectionBackendPid, getDefaultFetchSize, getForeignKeyTypeDefinition, getFullTextQueryText, getGis, getGisSchemas, getInternalSchemas, getMaximumColumnNameLength, getMaximumIndexNameLength, getMaximumSchemaNameLength, getMaximumTableNameLength, getPartitions, getPrimaryKeyStartValue, getPrimaryKeyType, getPublicSchema, getRangeClause, getShardCount, getSkipClause, getSpacialRefTable, grantReadOnlyUserPrivilegesToSqlgSchemas, hasContainerKeyToColumn, indexName, indexName, isH2, isHsqldb, isIndexPartOfCreateTable, isMariaDb, isMssqlServer, isMysql, isPostgresql, isSystemIndex, isTimestampz, lockTable, maybeWrapInQoutes, needForeignKeyIndex, needsSchemaCreationPrecommit, needsSchemaDropCascade, needsSemicolon, needsTemporaryTablePrefix, needsTemporaryTableSchema, needsTimeZone, nextSequenceVal, prepareDB, propertyTypeToJavaSqlType, propertyTypeToSqlDefinition, putJsonMetaObject, putJsonObject, renameColumn, renameTable, requiresIndexLengthLimit, requiresIndexName, schemaExists, sequenceName, setArray, setGeographyPoint, setLineString, setLquery, setLqueryArray, setLtree, setLtreeArray, setPoint, setPolygon, sqlArrayTypeNameToPropertyType, sqlgAddIndexEdgeSequenceColumn, sqlgCreateTopologyGraph, sqlgSqlgSchemaCreationScript, sqlgTopologyCreationScripts, sqlInsertEmptyValues, sqlToGetAllForeignKeys, sqlToTurnOffReferentialConstraintCheck, sqlToTurnOnReferentialConstraintCheck, sqlTruncate, sqlTypeToPropertyType, supportsBatchMode, supportsBigDecimal, supportsBigDecimalArrayValues, supportsBooleanArrayValues, supportsBulkWithinOut, supportsByteArrayValues, supportsByteValues, supportsCascade, supportsClientInfo, supportsDeferrableForeignKey, supportsDistribution, supportsDoubleArrayValues, supportsDurationArrayValues, supportsFloatArrayValues, supportsFloatValues, supportsFullValueExpression, supportsIfExists, supportsILike, supportsIntegerArrayValues, supportsJsonArrayValues, supportsJsonType, supportsLocalDateArrayValues, supportsLocalDateTimeArrayValues, supportsLocalTimeArrayValues, supportsLongArrayValues, supportsPartitioning, supportsPeriodArrayValues, supportsSchemaIfNotExists, supportsSchemas, supportsSharding, supportsShortArrayValues, supportsStreamingBatchMode, supportsStringArrayValues, supportsTemporaryTableOnCommitDrop, supportsTransactionalSchema, supportsTruncateMultipleTablesTogether, supportsType, supportsUUID, supportsValuesExpression, supportsZonedDateTimeArrayValues, temporaryTablePrefix, toByteArray, toRDBSStringLiteral, toRDBSStringLiteral, toSelectString, uniqueIndexConsidersNullValuesEqual, validateProperty, validateSchemaName, validateTableName, valueToValuesStringMethods inherited from interface org.umlg.sqlg.sql.dialect.SqlSchemaChangeDialect
lock, notifyChange, registerListener, unregisterListener 
- 
Field Details
- 
logger
protected final org.slf4j.Logger logger 
 - 
 - 
Constructor Details
- 
BaseSqlDialect
protected BaseSqlDialect() 
 - 
 - 
Method Details
- 
validateColumnName
- Specified by:
 validateColumnNamein interfaceSqlDialect
 - 
getSchemaNames
Description copied from interface:SqlDialectReturns all schemas. For some RDBMSes, like Cockroachdb and MariaDb, this is the database/catalog.- Specified by:
 getSchemaNamesin interfaceSqlDialect- Returns:
 - The list of schema names.
 
 - 
getVertexTables
public List<org.apache.commons.lang3.tuple.Triple<String,String, getVertexTablesString>> (DatabaseMetaData metaData) Description copied from interface:SqlDialectGet all the Vertex tables. i.e. all tables starting with 'V_'- Specified by:
 getVertexTablesin interfaceSqlDialect- Parameters:
 metaData- JDBC meta data.- Returns:
 - A triple holding the catalog, schema and table.
 
 - 
getEdgeTables
public List<org.apache.commons.lang3.tuple.Triple<String,String, getEdgeTablesString>> (DatabaseMetaData metaData) Description copied from interface:SqlDialectGet all the Edge tables. i.e. all tables starting with 'E_'- Specified by:
 getEdgeTablesin interfaceSqlDialect- Parameters:
 metaData- JDBC meta data.- Returns:
 - A triple holding the catalog, thea schema and the table.
 
 - 
flushVertexCache
public void flushVertexCache(SqlgGraph sqlgGraph, Map<SchemaTable, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>>> vertexCache) - Specified by:
 flushVertexCachein interfaceSqlBulkDialect
 - 
flushEdgeCache
public void flushEdgeCache(SqlgGraph sqlgGraph, Map<MetaEdge, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgEdge, org.apache.commons.lang3.tuple.Triple<SqlgVertex, SqlgVertex, Map<String, Object>>>>> edgeCache) - Specified by:
 flushEdgeCachein interfaceSqlBulkDialect
 - 
flushVertexPropertyCache
public void flushVertexPropertyCache(SqlgGraph sqlgGraph, Map<SchemaTable, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>>> vertexPropertyCache) - Specified by:
 flushVertexPropertyCachein interfaceSqlBulkDialect
 - 
flushEdgePropertyCache
public void flushEdgePropertyCache(SqlgGraph sqlgGraph, Map<SchemaTable, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgEdge, Map<String, Object>>>> edgePropertyCache) - Specified by:
 flushEdgePropertyCachein interfaceSqlBulkDialect
 - 
flushRemovedVertices
public void flushRemovedVertices(SqlgGraph sqlgGraph, Map<SchemaTable, List<SqlgVertex>> removeVertexCache) - Specified by:
 flushRemovedVerticesin interfaceSqlBulkDialect
 - 
flushRemovedEdges
- Specified by:
 flushRemovedEdgesin interfaceSqlBulkDialect
 - 
sqlInParameterLimit
public int sqlInParameterLimit()Description copied from interface:SqlDialectReturns the number of parameters that can be passed into a sql 'IN' statement.- Specified by:
 sqlInParameterLimitin interfaceSqlDialect- Returns:
 
 - 
getTableColumns
public List<org.apache.commons.lang3.tuple.Triple<String,Integer, getTableColumnsString>> (DatabaseMetaData metaData, String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) Description copied from interface:SqlDialectGet the columns for a table.- Specified by:
 getTableColumnsin interfaceSqlDialect- Parameters:
 metaData- JDBC meta data.- Returns:
 - The columns.
 
 - 
getPrimaryKeys
public List<String> getPrimaryKeys(DatabaseMetaData metaData, String catalog, String schemaPattern, String tableNamePattern) Description copied from interface:SqlDialectReturn the table's primary keys.- Specified by:
 getPrimaryKeysin interfaceSqlDialect- Parameters:
 metaData- JDBC meta data.catalog- The db catalog.schemaPattern- The schema name.tableNamePattern- The table name.- Returns:
 - A list of primary key column names.
 
 - 
getIndexInfo
public List<org.apache.commons.lang3.tuple.Triple<String,Boolean, getIndexInfoString>> (DatabaseMetaData metaData, String catalog, String schema, String table, boolean unique, boolean approximate) - Specified by:
 getIndexInfoin interfaceSqlDialect
 - 
setJson
public void setJson(PreparedStatement preparedStatement, int parameterStartIndex, com.fasterxml.jackson.databind.JsonNode right) - Specified by:
 setJsonin interfaceSqlDialect
 - 
handleOther
public void handleOther(Map<String, Object> properties, String columnName, Object o, PropertyType propertyType) - Specified by:
 handleOtherin interfaceSqlDialect
 - 
escapeQuotes
escape quotes by doubling them when we need a string inside quotes- Parameters:
 o-- Returns:
 
 
 -