Package tilda.db.stores
Class CommonStoreImpl
- java.lang.Object
-
- tilda.db.stores.CommonStoreImpl
-
- All Implemented Interfaces:
DBType
- Direct Known Subclasses:
BigQuery
,PostgreSQL
public abstract class CommonStoreImpl extends java.lang.Object implements DBType
-
-
Constructor Summary
Constructors Constructor Description CommonStoreImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
alterTableAddColumn(Connection com, Column col, java.lang.String defaultValue, java.lang.String temporaryDefaultValue)
boolean
alterTableAddFK(Connection Con, ForeignKey FK)
boolean
alterTableAddIndex(Connection Con, Index IX)
java.lang.String
alterTableAddIndexDDL(Index IX)
boolean
alterTableAlterColumnDefault(Connection Con, Column Col)
boolean
alterTableAlterColumnMulti(Connection Con, java.util.List<ColMetaColPair> BatchTypeCols, java.util.List<ColMetaColPair> BatchSizeCols, ZoneInfo_Data defaultZI)
boolean
alterTableAlterColumnNull(Connection Con, Column Col, java.lang.String DefaultValue)
boolean
alterTableAlterColumnNumericSize(Connection Con, ColumnMeta ColMeta, Column Col)
boolean
alterTableAlterColumnStringSize(Connection Con, ColumnMeta ColMeta, Column Col)
boolean
alterTableAlterColumnType(Connection Con, ColumnMeta ColMeta, Column Col, ZoneInfo_Data defaultZI)
boolean
alterTableDropColumn(Connection Con, Object Obj, java.lang.String ColumnName)
boolean
alterTableDropFK(Connection Con, Object Obj, FKMeta FK)
boolean
alterTableDropIndex(Connection Con, Object Obj, IndexMeta IX)
boolean
alterTableIndexAddCluster(Connection Con, Index IX)
boolean
alterTableIndexDropCluster(Connection Con, IndexMeta IX)
boolean
alterTableRenameIndex(Connection Con, Object Obj, java.lang.String OldName, java.lang.String NewName)
boolean
alterTableReplaceTablePK(Connection Con, Object Obj, PKMeta oldPK)
boolean
createKeysEntry(Connection Con, Object Obj)
boolean
createSchema(Connection Con, Schema S)
boolean
createTable(Connection Con, Object Obj)
boolean
createView(Connection Con, View V)
boolean
dropView(Connection Con, ViewMeta V, boolean cascade)
boolean
dropView(Connection Con, View V)
void
getColumnType(java.lang.StringBuilder Str, ColumnType T, java.lang.Integer S, ColumnMode M, boolean Collection, java.lang.Integer Precision, java.lang.Integer Scale)
abstract java.lang.String
getColumnType(ColumnType T, java.lang.Integer S, ColumnMode M, boolean Collection, java.lang.Integer Precision, java.lang.Integer Scale)
java.lang.String
getColumnType(Column C)
java.lang.String
getColumnType(Column C, ColumnType AggregateType)
java.lang.String
getColumnTypeRaw(ColumnType Type, int Size, boolean isCollection)
abstract java.lang.String
getColumnTypeRaw(ColumnType Type, int Size, boolean Calculated, boolean isCollection, boolean MultiOverride)
java.lang.String
getColumnTypeRaw(Column C, boolean MultiOverride)
java.time.LocalDate
getCurrentDate(Connection Con)
java.time.ZonedDateTime
getCurrentDateTime(Connection Con)
java.time.ZonedDateTime
getCurrentTimestamp(Connection Con)
void
getFullColumnVar(java.lang.StringBuilder Str, java.lang.String SchemaName, java.lang.String TableName, java.lang.String ColumnName)
java.lang.String
getFullColumnVar(Column C)
java.lang.String
getFullColumnVar(Column C, int i)
void
getFullTableVar(java.lang.StringBuilder Str, java.lang.String SchemaName, java.lang.String TableName)
java.lang.String
getFullTableVar(Object O)
java.lang.String
getFullTableVar(Object O, int i)
java.lang.String
getSelectLimitClause(int Start, int Size)
java.lang.String
getShortColumnVar(java.lang.String name)
java.lang.String
getShortColumnVar(Column C)
protected abstract ColumnType
getSubTypeMapping(java.lang.String Name, java.lang.String TypeName, ColumnType TildaType)
StringStringPair
getTypeMapping(int Type, java.lang.String Name, int Size, java.lang.String TypeName)
boolean
moveTableView(Connection Con, Base base, java.lang.String oldSchemaName)
boolean
renameTableColumn(Connection con, Column col, java.lang.String oldName)
boolean
renameTableView(Connection Con, Base base, java.lang.String oldName)
java.lang.String
rewriteExpressionColumnQuoting(java.lang.String expr)
void
setArray(Connection C, java.sql.PreparedStatement PS, int i, ColumnType Type, java.util.List<java.sql.Array> allocatedArrays, java.util.Collection<?> val)
void
setOrderByWithNullsOrdering(Connection C, java.lang.StringBuilder Str, ColumnDefinition Col, boolean Asc, boolean NullsLast)
void
truncateTable(Connection C, java.lang.String schemaName, java.lang.String tableName, boolean cascade)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface tilda.db.stores.DBType
age, alterTableAlterColumnComment, alterTableComment, cancel, fullIdentifierOnUpdate, getAclRolesScript, getAggregateStr, getBackendConnectionId, getColumnQuotingEndChar, getColumnQuotingStartChar, getConnectionCancelStates, getConnectionLockMsgs, getConnectionNoDataStates, getCurrentDateStr, getCurrentDateTimeStr, getCurrentTimestampStr, getDBStringType, getHelperFunctionsScript, getJsonParametrizedQueryPlaceHolder, getMaxColumnNameSize, getMaxTableNameSize, getName, getSQlCodeGen, isCaseSentitiveSchemaTableViewNames, isSuperUser, needsSavepoint, reorgTable, supportsArrays, supportsFilterClause, supportsFirstLastAggregates, supportsForeignKeys, supportsIndices, supportsPrimaryKeys, supportsReorg, supportsSelectLimit, supportsSelectOffset, supportsSuperMetaDataQueries, within
-
-
-
-
Method Detail
-
getSelectLimitClause
public java.lang.String getSelectLimitClause(int Start, int Size)
- Specified by:
getSelectLimitClause
in interfaceDBType
-
getSubTypeMapping
protected abstract ColumnType getSubTypeMapping(java.lang.String Name, java.lang.String TypeName, ColumnType TildaType) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getTypeMapping
public StringStringPair getTypeMapping(int Type, java.lang.String Name, int Size, java.lang.String TypeName) throws java.lang.Exception
- Specified by:
getTypeMapping
in interfaceDBType
- Throws:
java.lang.Exception
-
createSchema
public boolean createSchema(Connection Con, Schema S) throws java.lang.Exception
- Specified by:
createSchema
in interfaceDBType
- Throws:
java.lang.Exception
-
createTable
public boolean createTable(Connection Con, Object Obj) throws java.lang.Exception
- Specified by:
createTable
in interfaceDBType
- Throws:
java.lang.Exception
-
createKeysEntry
public boolean createKeysEntry(Connection Con, Object Obj) throws java.lang.Exception
- Specified by:
createKeysEntry
in interfaceDBType
- Throws:
java.lang.Exception
-
dropView
public boolean dropView(Connection Con, View V) throws java.lang.Exception
-
dropView
public boolean dropView(Connection Con, ViewMeta V, boolean cascade) throws java.lang.Exception
-
createView
public boolean createView(Connection Con, View V) throws java.lang.Exception
- Specified by:
createView
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAddColumn
public boolean alterTableAddColumn(Connection com, Column col, java.lang.String defaultValue, java.lang.String temporaryDefaultValue) throws java.lang.Exception
- Specified by:
alterTableAddColumn
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAlterColumnDefault
public boolean alterTableAlterColumnDefault(Connection Con, Column Col) throws java.lang.Exception
- Specified by:
alterTableAlterColumnDefault
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableDropColumn
public boolean alterTableDropColumn(Connection Con, Object Obj, java.lang.String ColumnName) throws java.lang.Exception
- Specified by:
alterTableDropColumn
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAlterColumnNull
public boolean alterTableAlterColumnNull(Connection Con, Column Col, java.lang.String DefaultValue) throws java.lang.Exception
- Specified by:
alterTableAlterColumnNull
in interfaceDBType
- Throws:
java.lang.Exception
-
getColumnType
public java.lang.String getColumnType(Column C)
- Specified by:
getColumnType
in interfaceDBType
-
getColumnType
public java.lang.String getColumnType(Column C, ColumnType AggregateType)
- Specified by:
getColumnType
in interfaceDBType
-
getColumnType
public void getColumnType(java.lang.StringBuilder Str, ColumnType T, java.lang.Integer S, ColumnMode M, boolean Collection, java.lang.Integer Precision, java.lang.Integer Scale)
- Specified by:
getColumnType
in interfaceDBType
-
getColumnType
public abstract java.lang.String getColumnType(ColumnType T, java.lang.Integer S, ColumnMode M, boolean Collection, java.lang.Integer Precision, java.lang.Integer Scale)
-
getColumnTypeRaw
public java.lang.String getColumnTypeRaw(Column C, boolean MultiOverride)
- Specified by:
getColumnTypeRaw
in interfaceDBType
-
getColumnTypeRaw
public java.lang.String getColumnTypeRaw(ColumnType Type, int Size, boolean isCollection)
- Specified by:
getColumnTypeRaw
in interfaceDBType
-
getColumnTypeRaw
public abstract java.lang.String getColumnTypeRaw(ColumnType Type, int Size, boolean Calculated, boolean isCollection, boolean MultiOverride)
-
alterTableAlterColumnStringSize
public boolean alterTableAlterColumnStringSize(Connection Con, ColumnMeta ColMeta, Column Col) throws java.lang.Exception
- Specified by:
alterTableAlterColumnStringSize
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAlterColumnNumericSize
public boolean alterTableAlterColumnNumericSize(Connection Con, ColumnMeta ColMeta, Column Col) throws java.lang.Exception
- Specified by:
alterTableAlterColumnNumericSize
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAlterColumnType
public boolean alterTableAlterColumnType(Connection Con, ColumnMeta ColMeta, Column Col, ZoneInfo_Data defaultZI) throws java.lang.Exception
- Specified by:
alterTableAlterColumnType
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAlterColumnMulti
public boolean alterTableAlterColumnMulti(Connection Con, java.util.List<ColMetaColPair> BatchTypeCols, java.util.List<ColMetaColPair> BatchSizeCols, ZoneInfo_Data defaultZI) throws java.lang.Exception
- Specified by:
alterTableAlterColumnMulti
in interfaceDBType
- Throws:
java.lang.Exception
-
getFullTableVar
public java.lang.String getFullTableVar(Object O)
- Specified by:
getFullTableVar
in interfaceDBType
-
getFullTableVar
public java.lang.String getFullTableVar(Object O, int i)
- Specified by:
getFullTableVar
in interfaceDBType
-
getShortColumnVar
public java.lang.String getShortColumnVar(java.lang.String name)
- Specified by:
getShortColumnVar
in interfaceDBType
-
getShortColumnVar
public java.lang.String getShortColumnVar(Column C)
- Specified by:
getShortColumnVar
in interfaceDBType
-
rewriteExpressionColumnQuoting
public java.lang.String rewriteExpressionColumnQuoting(java.lang.String expr)
- Specified by:
rewriteExpressionColumnQuoting
in interfaceDBType
-
getFullColumnVar
public java.lang.String getFullColumnVar(Column C)
- Specified by:
getFullColumnVar
in interfaceDBType
-
getFullColumnVar
public java.lang.String getFullColumnVar(Column C, int i)
- Specified by:
getFullColumnVar
in interfaceDBType
-
getFullColumnVar
public void getFullColumnVar(java.lang.StringBuilder Str, java.lang.String SchemaName, java.lang.String TableName, java.lang.String ColumnName)
- Specified by:
getFullColumnVar
in interfaceDBType
-
getFullTableVar
public void getFullTableVar(java.lang.StringBuilder Str, java.lang.String SchemaName, java.lang.String TableName)
- Specified by:
getFullTableVar
in interfaceDBType
-
setArray
public void setArray(Connection C, java.sql.PreparedStatement PS, int i, ColumnType Type, java.util.List<java.sql.Array> allocatedArrays, java.util.Collection<?> val) throws java.lang.Exception
-
setOrderByWithNullsOrdering
public void setOrderByWithNullsOrdering(Connection C, java.lang.StringBuilder Str, ColumnDefinition Col, boolean Asc, boolean NullsLast)
- Specified by:
setOrderByWithNullsOrdering
in interfaceDBType
-
truncateTable
public void truncateTable(Connection C, java.lang.String schemaName, java.lang.String tableName, boolean cascade) throws java.lang.Exception
- Specified by:
truncateTable
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableReplaceTablePK
public boolean alterTableReplaceTablePK(Connection Con, Object Obj, PKMeta oldPK) throws java.lang.Exception
- Specified by:
alterTableReplaceTablePK
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableDropFK
public boolean alterTableDropFK(Connection Con, Object Obj, FKMeta FK) throws java.lang.Exception
- Specified by:
alterTableDropFK
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAddFK
public boolean alterTableAddFK(Connection Con, ForeignKey FK) throws java.lang.Exception
- Specified by:
alterTableAddFK
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableDropIndex
public boolean alterTableDropIndex(Connection Con, Object Obj, IndexMeta IX) throws java.lang.Exception
- Specified by:
alterTableDropIndex
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableIndexDropCluster
public boolean alterTableIndexDropCluster(Connection Con, IndexMeta IX) throws java.lang.Exception
- Specified by:
alterTableIndexDropCluster
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAddIndexDDL
public java.lang.String alterTableAddIndexDDL(Index IX) throws java.lang.Exception
- Specified by:
alterTableAddIndexDDL
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableAddIndex
public boolean alterTableAddIndex(Connection Con, Index IX) throws java.lang.Exception
- Specified by:
alterTableAddIndex
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableIndexAddCluster
public boolean alterTableIndexAddCluster(Connection Con, Index IX) throws java.lang.Exception
- Specified by:
alterTableIndexAddCluster
in interfaceDBType
- Throws:
java.lang.Exception
-
alterTableRenameIndex
public boolean alterTableRenameIndex(Connection Con, Object Obj, java.lang.String OldName, java.lang.String NewName) throws java.lang.Exception
- Specified by:
alterTableRenameIndex
in interfaceDBType
- Throws:
java.lang.Exception
-
moveTableView
public boolean moveTableView(Connection Con, Base base, java.lang.String oldSchemaName) throws java.lang.Exception
- Specified by:
moveTableView
in interfaceDBType
- Throws:
java.lang.Exception
-
renameTableView
public boolean renameTableView(Connection Con, Base base, java.lang.String oldName) throws java.lang.Exception
- Specified by:
renameTableView
in interfaceDBType
- Throws:
java.lang.Exception
-
renameTableColumn
public boolean renameTableColumn(Connection con, Column col, java.lang.String oldName) throws java.lang.Exception
- Specified by:
renameTableColumn
in interfaceDBType
- Throws:
java.lang.Exception
-
getCurrentTimestamp
public java.time.ZonedDateTime getCurrentTimestamp(Connection Con) throws java.lang.Exception
- Specified by:
getCurrentTimestamp
in interfaceDBType
- Throws:
java.lang.Exception
-
getCurrentDateTime
public java.time.ZonedDateTime getCurrentDateTime(Connection Con) throws java.lang.Exception
- Specified by:
getCurrentDateTime
in interfaceDBType
- Throws:
java.lang.Exception
-
getCurrentDate
public java.time.LocalDate getCurrentDate(Connection Con) throws java.lang.Exception
- Specified by:
getCurrentDate
in interfaceDBType
- Throws:
java.lang.Exception
-
-