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
Fields inherited from interface org.umlg.sqlg.sql.dialect.SqlDialect
INDEX_POSTFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
escape quotes by doubling them when we need a string inside quotesvoid
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) void
flushEdgePropertyCache
(SqlgGraph sqlgGraph, Map<SchemaTable, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgEdge, Map<String, Object>>>> edgePropertyCache) void
flushRemovedEdges
(SqlgGraph sqlgGraph, Map<SchemaTable, List<SqlgEdge>> removeEdgeCache) void
flushRemovedVertices
(SqlgGraph sqlgGraph, Map<SchemaTable, List<SqlgVertex>> removeVertexCache) void
flushVertexCache
(SqlgGraph sqlgGraph, Map<SchemaTable, org.apache.commons.lang3.tuple.Pair<SortedSet<String>, Map<SqlgVertex, Map<String, Object>>>> vertexCache) void
flushVertexPropertyCache
(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.void
handleOther
(Map<String, Object> properties, String columnName, Object o, PropertyType propertyType) void
setJson
(PreparedStatement preparedStatement, int parameterStartIndex, com.fasterxml.jackson.databind.JsonNode right) int
Returns the number of parameters that can be passed into a sql 'IN' statement.void
validateColumnName
(String column) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.umlg.sqlg.sql.dialect.SqlBulkDialect
bulkAddEdges, constructCompleteCopyCommandSqlEdge, constructCompleteCopyCommandSqlVertex, constructCompleteCopyCommandSqlVertex, constructCompleteCopyCommandTemporarySqlVertex, getBatchNull, streamSql, temporaryTableCopyCommandSqlVertex, writeStreamingEdge, writeStreamingVertex, writeTemporaryStreamingVertex
Methods 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, valueToValuesString
Methods 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:
validateColumnName
in interfaceSqlDialect
-
getSchemaNames
Description copied from interface:SqlDialect
Returns all schemas. For some RDBMSes, like Cockroachdb and MariaDb, this is the database/catalog.- Specified by:
getSchemaNames
in 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:SqlDialect
Get all the Vertex tables. i.e. all tables starting with 'V_'- Specified by:
getVertexTables
in 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:SqlDialect
Get all the Edge tables. i.e. all tables starting with 'E_'- Specified by:
getEdgeTables
in 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:
flushVertexCache
in 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:
flushEdgeCache
in 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:
flushVertexPropertyCache
in 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:
flushEdgePropertyCache
in interfaceSqlBulkDialect
-
flushRemovedVertices
public void flushRemovedVertices(SqlgGraph sqlgGraph, Map<SchemaTable, List<SqlgVertex>> removeVertexCache) - Specified by:
flushRemovedVertices
in interfaceSqlBulkDialect
-
flushRemovedEdges
- Specified by:
flushRemovedEdges
in interfaceSqlBulkDialect
-
sqlInParameterLimit
public int sqlInParameterLimit()Description copied from interface:SqlDialect
Returns the number of parameters that can be passed into a sql 'IN' statement.- Specified by:
sqlInParameterLimit
in 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:SqlDialect
Get the columns for a table.- Specified by:
getTableColumns
in 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:SqlDialect
Return the table's primary keys.- Specified by:
getPrimaryKeys
in 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:
getIndexInfo
in interfaceSqlDialect
-
setJson
public void setJson(PreparedStatement preparedStatement, int parameterStartIndex, com.fasterxml.jackson.databind.JsonNode right) - Specified by:
setJson
in interfaceSqlDialect
-
handleOther
public void handleOther(Map<String, Object> properties, String columnName, Object o, PropertyType propertyType) - Specified by:
handleOther
in interfaceSqlDialect
-
escapeQuotes
escape quotes by doubling them when we need a string inside quotes- Parameters:
o
-- Returns:
-