Package one.microstream.afs.sql.types
Class SqlProvider.Abstract
java.lang.Object
one.microstream.afs.sql.types.SqlProvider.Abstract
- All Implemented Interfaces:
SqlProvider
- Direct Known Subclasses:
SqlProviderHana.Default,SqlProviderMariaDb.Default,SqlProviderOracle.Default,SqlProviderPostgres.Default,SqlProviderSqlite.Default
- Enclosing interface:
- SqlProvider
public abstract static class SqlProvider.Abstract extends Object implements SqlProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface one.microstream.afs.sql.types.SqlProvider
SqlProvider.Abstract -
Field Summary
Fields inherited from interface one.microstream.afs.sql.types.SqlProvider
DATA_COLUMN_NAME, DATA_COLUMN_TYPE, END_COLUMN_NAME, END_COLUMN_TYPE, IDENTIFIER_COLUMN_LENGTH, IDENTIFIER_COLUMN_NAME, IDENTIFIER_COLUMN_TYPE, START_COLUMN_NAME, START_COLUMN_TYPE -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstract(String catalog, String schema, DataSource dataSource) -
Method Summary
Modifier and Type Method Description protected VarStringaddNameQuoted(VarString vs, String name)protected VarStringaddSqlColumnName(VarString vs, String columnName)protected VarStringaddSqlTableName(VarString vs, String tableName)Stringcatalog()StringcopyFileQuery(String sourceTableName, String targetTableName)insert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?StringcountFilesQuery(String tableName)select count(*) from [tableName]StringdeleteFileQuery(String tableName)delete from [tableName] where 'identifier' = ?StringdeleteFileQueryFromEnd(String tableName)delete from [tableName] where 'identifier' = ? and 'end' >= ?StringdeleteFileQueryFromStart(String tableName)delete from [tableName] where 'identifier' = ? and 'start' >= ?<T> Texecute(SqlOperation<T> operation)StringfileExistsQuery(String tableName)select count(*) from [tableName] where 'identifier' = ?StringfileSizeQuery(String tableName)select count(*), max('end') from [tableName] where 'identifier' = ?protected StringinternalReadDataQuery(String tableName, VarString... conditions)StringlistFilesQuery(String tableName)select distinct 'identifier' from [tableName]StringmoveFileQuerySameParent(String tableName)update [tableName] set 'identifier' = ? where 'identifier' = ?Set<String>queryDirectories(Connection connection, String prefix)booleanqueryDirectoryExists(Connection connection, String tableName)protected charquoteClose()protected charquoteOpen()StringreadDataQuery(String tableName)select * from [tableName] where 'identifier' = ? order by 'end' descStringreadDataQueryWithLength(String tableName)select * from [tableName] where 'identifier' = ? and 'start' < ? order by 'end' descStringreadDataQueryWithOffset(String tableName)select * from [tableName] where 'identifier' = ? and 'end' >= ? order by 'end' descStringreadDataQueryWithRange(String tableName)select * from [tableName] where 'identifier' = ? and 'end' >= ? and 'start' <= ? order by 'end' descStringreadMetadataQuery(String tableName)select 'start', 'end' from [tableName] where 'identifier' = ?StringreadMetadataQuerySingleSegment(String tableName)select 'start', 'end' from [tableName] where 'identifier' = ? and start <= ? and end >= ?Stringschema()voidsetBlob(PreparedStatement statement, int index, InputStream inputStream, long length)StringwriteDataQuery(String tableName)insert into [tableName] ('identifier', 'start', 'end', 'data') values (?, ?, ?, ?)
-
Constructor Details
-
Method Details
-
quoteOpen
protected char quoteOpen() -
quoteClose
protected char quoteClose() -
addSqlTableName
-
addSqlColumnName
-
addNameQuoted
-
internalReadDataQuery
-
catalog
- Specified by:
catalogin interfaceSqlProvider
-
schema
- Specified by:
schemain interfaceSqlProvider
-
execute
- Specified by:
executein interfaceSqlProvider
-
setBlob
public void setBlob(PreparedStatement statement, int index, InputStream inputStream, long length) throws SQLException- Specified by:
setBlobin interfaceSqlProvider- Throws:
SQLException
-
queryDirectoryExists
- Specified by:
queryDirectoryExistsin interfaceSqlProvider- Throws:
SQLException
-
queryDirectories
- Specified by:
queryDirectoriesin interfaceSqlProvider- Throws:
SQLException
-
fileSizeQuery
Description copied from interface:SqlProviderselect count(*), max('end') from [tableName] where 'identifier' = ?- Specified by:
fileSizeQueryin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
listFilesQuery
Description copied from interface:SqlProviderselect distinct 'identifier' from [tableName]
- Specified by:
listFilesQueryin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
countFilesQuery
Description copied from interface:SqlProviderselect count(*) from [tableName]
- Specified by:
countFilesQueryin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
readMetadataQuery
Description copied from interface:SqlProviderselect 'start', 'end' from [tableName] where 'identifier' = ?
- Specified by:
readMetadataQueryin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
readMetadataQuerySingleSegment
Description copied from interface:SqlProviderselect 'start', 'end' from [tableName] where 'identifier' = ? and start <= ? and end >= ?
- Specified by:
readMetadataQuerySingleSegmentin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
readDataQuery
Description copied from interface:SqlProviderselect * from [tableName] where 'identifier' = ? order by 'end' desc
- Specified by:
readDataQueryin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
readDataQueryWithLength
Description copied from interface:SqlProviderselect * from [tableName] where 'identifier' = ? and 'start' < ? order by 'end' desc
- Specified by:
readDataQueryWithLengthin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
readDataQueryWithOffset
Description copied from interface:SqlProviderselect * from [tableName] where 'identifier' = ? and 'end' >= ? order by 'end' desc
- Specified by:
readDataQueryWithOffsetin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
readDataQueryWithRange
Description copied from interface:SqlProviderselect * from [tableName] where 'identifier' = ? and 'end' >= ? and 'start' <= ? order by 'end' desc
- Specified by:
readDataQueryWithRangein interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
fileExistsQuery
Description copied from interface:SqlProviderselect count(*) from [tableName] where 'identifier' = ?
- Specified by:
fileExistsQueryin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
deleteFileQuery
Description copied from interface:SqlProviderdelete from [tableName] where 'identifier' = ?
- Specified by:
deleteFileQueryin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
deleteFileQueryFromStart
Description copied from interface:SqlProviderdelete from [tableName] where 'identifier' = ? and 'start' >= ?
- Specified by:
deleteFileQueryFromStartin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
deleteFileQueryFromEnd
Description copied from interface:SqlProviderdelete from [tableName] where 'identifier' = ? and 'end' >= ?
- Specified by:
deleteFileQueryFromEndin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
writeDataQuery
Description copied from interface:SqlProviderinsert into [tableName] ('identifier', 'start', 'end', 'data') values (?, ?, ?, ?)- Specified by:
writeDataQueryin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
moveFileQuerySameParent
Description copied from interface:SqlProviderupdate [tableName] set 'identifier' = ? where 'identifier' = ?
- Specified by:
moveFileQuerySameParentin interfaceSqlProvider- Parameters:
tableName- the table to query- Returns:
- the native query string
-
copyFileQuery
Description copied from interface:SqlProviderinsert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?- Specified by:
copyFileQueryin interfaceSqlProvider- Parameters:
sourceTableName- the source table name to querytargetTableName- the target table name to query- Returns:
- the native query string
-