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 protected
Abstract(String catalog, String schema, DataSource dataSource)
-
Method Summary
Modifier and Type Method Description protected VarString
addNameQuoted(VarString vs, String name)
protected VarString
addSqlColumnName(VarString vs, String columnName)
protected VarString
addSqlTableName(VarString vs, String tableName)
String
catalog()
String
copyFileQuery(String sourceTableName, String targetTableName)
insert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?String
countFilesQuery(String tableName)
select count(*) from [tableName]String
deleteFileQuery(String tableName)
delete from [tableName] where 'identifier' = ?String
deleteFileQueryFromEnd(String tableName)
delete from [tableName] where 'identifier' = ? and 'end' >= ?String
deleteFileQueryFromStart(String tableName)
delete from [tableName] where 'identifier' = ? and 'start' >= ?<T> T
execute(SqlOperation<T> operation)
String
fileExistsQuery(String tableName)
select count(*) from [tableName] where 'identifier' = ?String
fileSizeQuery(String tableName)
select count(*), max('end') from [tableName] where 'identifier' = ?protected String
internalReadDataQuery(String tableName, VarString... conditions)
String
listFilesQuery(String tableName)
select distinct 'identifier' from [tableName]String
moveFileQuerySameParent(String tableName)
update [tableName] set 'identifier' = ? where 'identifier' = ?Set<String>
queryDirectories(Connection connection, String prefix)
boolean
queryDirectoryExists(Connection connection, String tableName)
protected char
quoteClose()
protected char
quoteOpen()
String
readDataQuery(String tableName)
select * from [tableName] where 'identifier' = ? order by 'end' descString
readDataQueryWithLength(String tableName)
select * from [tableName] where 'identifier' = ? and 'start' < ? order by 'end' descString
readDataQueryWithOffset(String tableName)
select * from [tableName] where 'identifier' = ? and 'end' >= ? order by 'end' descString
readDataQueryWithRange(String tableName)
select * from [tableName] where 'identifier' = ? and 'end' >= ? and 'start' <= ? order by 'end' descString
readMetadataQuery(String tableName)
select 'start', 'end' from [tableName] where 'identifier' = ?String
readMetadataQuerySingleSegment(String tableName)
select 'start', 'end' from [tableName] where 'identifier' = ? and start <= ? and end >= ?String
schema()
void
setBlob(PreparedStatement statement, int index, InputStream inputStream, long length)
String
writeDataQuery(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:
catalog
in interfaceSqlProvider
-
schema
- Specified by:
schema
in interfaceSqlProvider
-
execute
- Specified by:
execute
in interfaceSqlProvider
-
setBlob
public void setBlob(PreparedStatement statement, int index, InputStream inputStream, long length) throws SQLException- Specified by:
setBlob
in interfaceSqlProvider
- Throws:
SQLException
-
queryDirectoryExists
- Specified by:
queryDirectoryExists
in interfaceSqlProvider
- Throws:
SQLException
-
queryDirectories
- Specified by:
queryDirectories
in interfaceSqlProvider
- Throws:
SQLException
-
fileSizeQuery
Description copied from interface:SqlProvider
select count(*), max('end') from [tableName] where 'identifier' = ?
- Specified by:
fileSizeQuery
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
listFilesQuery
Description copied from interface:SqlProvider
select distinct 'identifier' from [tableName]
- Specified by:
listFilesQuery
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
countFilesQuery
Description copied from interface:SqlProvider
select count(*) from [tableName]
- Specified by:
countFilesQuery
in interfaceSqlProvider
-
readMetadataQuery
Description copied from interface:SqlProvider
select 'start', 'end' from [tableName] where 'identifier' = ?
- Specified by:
readMetadataQuery
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readMetadataQuerySingleSegment
Description copied from interface:SqlProvider
select 'start', 'end' from [tableName] where 'identifier' = ? and start <= ? and end >= ?
- Specified by:
readMetadataQuerySingleSegment
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readDataQuery
Description copied from interface:SqlProvider
select * from [tableName] where 'identifier' = ? order by 'end' desc
- Specified by:
readDataQuery
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readDataQueryWithLength
Description copied from interface:SqlProvider
select * from [tableName] where 'identifier' = ? and 'start' < ? order by 'end' desc
- Specified by:
readDataQueryWithLength
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readDataQueryWithOffset
Description copied from interface:SqlProvider
select * from [tableName] where 'identifier' = ? and 'end' >= ? order by 'end' desc
- Specified by:
readDataQueryWithOffset
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
readDataQueryWithRange
Description copied from interface:SqlProvider
select * from [tableName] where 'identifier' = ? and 'end' >= ? and 'start' <= ? order by 'end' desc
- Specified by:
readDataQueryWithRange
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
fileExistsQuery
Description copied from interface:SqlProvider
select count(*) from [tableName] where 'identifier' = ?
- Specified by:
fileExistsQuery
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
deleteFileQuery
Description copied from interface:SqlProvider
delete from [tableName] where 'identifier' = ?
- Specified by:
deleteFileQuery
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
deleteFileQueryFromStart
Description copied from interface:SqlProvider
delete from [tableName] where 'identifier' = ? and 'start' >= ?
- Specified by:
deleteFileQueryFromStart
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
deleteFileQueryFromEnd
Description copied from interface:SqlProvider
delete from [tableName] where 'identifier' = ? and 'end' >= ?
- Specified by:
deleteFileQueryFromEnd
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
writeDataQuery
Description copied from interface:SqlProvider
insert into [tableName] ('identifier', 'start', 'end', 'data') values (?, ?, ?, ?)
- Specified by:
writeDataQuery
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
moveFileQuerySameParent
Description copied from interface:SqlProvider
update [tableName] set 'identifier' = ? where 'identifier' = ?
- Specified by:
moveFileQuerySameParent
in interfaceSqlProvider
- Parameters:
tableName
- the table to query- Returns:
- the native query string
-
copyFileQuery
Description copied from interface:SqlProvider
insert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?
- Specified by:
copyFileQuery
in interfaceSqlProvider
- Parameters:
sourceTableName
- the source table name to querytargetTableName
- the target table name to query- Returns:
- the native query string
-