Package one.microstream.afs.sql
Interface SqlProvider
- All Known Subinterfaces:
- HibernateProvider,- SqlProviderHana,- SqlProviderMariaDb,- SqlProviderMySql,- SqlProviderOracle,- SqlProviderPostgres,- SqlProviderSqlite
- All Known Implementing Classes:
- HibernateProvider.Default,- SqlProvider.Abstract,- SqlProviderHana.Default,- SqlProviderMariaDb.Default,- SqlProviderMySql.Default,- SqlProviderOracle.Default,- SqlProviderPostgres.Default,- SqlProviderSqlite.Default
public interface SqlProvider
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classSqlProvider.Abstract
- 
Field SummaryFields Modifier and Type Field Description static StringDATA_COLUMN_NAMEstatic intDATA_COLUMN_TYPEstatic StringEND_COLUMN_NAMEstatic intEND_COLUMN_TYPEstatic intIDENTIFIER_COLUMN_LENGTHstatic StringIDENTIFIER_COLUMN_NAMEstatic intIDENTIFIER_COLUMN_TYPEstatic StringSTART_COLUMN_NAMEstatic intSTART_COLUMN_TYPE
- 
Method SummaryModifier and Type Method Description Stringcatalog()StringcopyFileQuery(String sourceTableName, String targetTableName)insert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?Iterable<String>createDirectoryQueries(String tableName)create table [tableName] ( 'identifier' varchar(IDENTIFIER_COLUMN_LENGTH) not null, 'start' bigint not null, 'end' bigint not null, 'blob' not null, primary key ('identifier', 'start') )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' = ?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)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 (?, ?, ?, ?)
- 
Field Details- 
IDENTIFIER_COLUMN_NAME- See Also:
- Constant Field Values
 
- 
IDENTIFIER_COLUMN_TYPEstatic final int IDENTIFIER_COLUMN_TYPE- See Also:
- Constant Field Values
 
- 
IDENTIFIER_COLUMN_LENGTHstatic final int IDENTIFIER_COLUMN_LENGTH- See Also:
- Constant Field Values
 
- 
START_COLUMN_NAME- See Also:
- Constant Field Values
 
- 
START_COLUMN_TYPEstatic final int START_COLUMN_TYPE- See Also:
- Constant Field Values
 
- 
END_COLUMN_NAME- See Also:
- Constant Field Values
 
- 
END_COLUMN_TYPEstatic final int END_COLUMN_TYPE- See Also:
- Constant Field Values
 
- 
DATA_COLUMN_NAME- See Also:
- Constant Field Values
 
- 
DATA_COLUMN_TYPEstatic final int DATA_COLUMN_TYPE- See Also:
- Constant Field Values
 
 
- 
- 
Method Details- 
catalogString catalog()
- 
schemaString schema()
- 
execute
- 
setBlobvoid setBlob(PreparedStatement statement, int index, InputStream inputStream, long length) throws SQLException- Throws:
- SQLException
 
- 
queryDirectoryExists- Throws:
- SQLException
 
- 
queryDirectories- Throws:
- SQLException
 
- 
fileSizeQueryselect count(*), max('end') from [tableName] where 'identifier' = ?
- 
listFilesQueryselect distinct 'identifier' from [tableName] 
- 
readMetadataQueryselect 'start', 'end' from [tableName] where 'identifier' = ? 
- 
readMetadataQuerySingleSegmentselect 'start', 'end' from [tableName] where 'identifier' = ? and start <= ? and end >= ? 
- 
readDataQueryselect from [tableName] where 'identifier' = ? order by 'end' desc 
- 
readDataQueryWithLengthselect from [tableName] where 'identifier' = ? and 'start' < ? order by 'end' desc 
- 
readDataQueryWithOffsetselect from [tableName] where 'identifier' = ? and 'end' >= ? order by 'end' desc 
- 
readDataQueryWithRangeselect from [tableName] where 'identifier' = ? and 'end' >= ? and 'start' <= ? order by 'end' desc 
- 
fileExistsQueryselect count(*) from [tableName] where 'identifier' = ? 
- 
createDirectoryQueriescreate table [tableName] ( 'identifier' varchar(IDENTIFIER_COLUMN_LENGTH) not null, 'start' bigint not null, 'end' bigint not null, 'blob' not null, primary key ('identifier', 'start') )
- 
deleteFileQuerydelete from [tableName] where 'identifier' = ? 
- 
deleteFileQueryFromStartdelete from [tableName] where 'identifier' = ? and 'start' >= ? 
- 
deleteFileQueryFromEnddelete from [tableName] where 'identifier' = ? and 'end' >= ? 
- 
writeDataQueryinsert into [tableName] ('identifier', 'start', 'end', 'data') values (?, ?, ?, ?)
- 
moveFileQuerySameParentupdate [tableName] set 'identifier' = ? where 'identifier' = ? 
- 
copyFileQueryinsert into [targetTableName] ('identifier', 'start', 'end', 'data') select ?, 'start', 'end', 'data' from [sourceTableName] where 'identifier' = ?
 
-