public interface DbmsHandler extends HasCreateFromConnectionMethods
Dbms
.Modifier and Type | Field and Description |
---|---|
static Predicate<String> |
NO_FILTER
A String predicate that always returns true.
|
Modifier and Type | Method and Description |
---|---|
void |
executeDelete(String sql,
List<?> values)
Executes an SQL delete command.
|
<F extends FieldTrait & ReferenceFieldTrait<?,?,?>> |
executeInsert(String sql,
List<?> values,
List<F> generatedKeyFields,
Consumer<List<Long>> generatedKeyConsumer)
Executes an SQL update command.
|
<T> Stream<T> |
executeQuery(String sql,
List<?> values,
SqlFunction<ResultSet,T> rsMapper)
Eagerly executes a SQL query and subsequently maps each row in the
ResultSet using a provided mapper and return a stream of the
mapped objects. |
default <T> Stream<T> |
executeQuery(String sql,
SqlFunction<ResultSet,T> rsMapper)
Eagerly executes a SQL query and subsequently maps each row in the
ResultSet using a provided mapper and return a Stream of the mapped
objects.
|
<T> AsynchronousQueryResult<T> |
executeQueryAsync(String sql,
List<?> values,
Function<ResultSet,T> rsMapper)
Lazily Executes a SQL query and subsequently maps each row in the
ResultSet using a provided mapper and return a stream of the
mapped objects. |
void |
executeUpdate(String sql,
List<?> values)
Executes an SQL update command.
|
String |
getDbmsInfoString()
Returns a string with information on the current dbms.
|
default CompletableFuture<Project> |
readSchemaMetadata(ProgressMeasure progressListener)
Reads the schema metadata with populated
Schemas that are
available in this database. |
CompletableFuture<Project> |
readSchemaMetadata(ProgressMeasure progressListener,
Predicate<String> filterCriteria)
/**
Reads the schema metadata with populated
Schemas that are
available in this database. |
createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStruct
default CompletableFuture<Project> readSchemaMetadata(ProgressMeasure progressListener)
Schemas
that are
available in this database. The schemas are populated by all their
sub-items such as tables, columns etc. Schemas that are a part of the
getDbms().getType().getSchemaExcludSet()
set are excluded from
the model.
This method can be used to read a complete inventory of the database structure.
progressListener
- the progress listenerCompletableFuture<Project> readSchemaMetadata(ProgressMeasure progressListener, Predicate<String> filterCriteria)
Schemas
that are
available in this database. The schemas are populated by all their
sub-items such as tables, columns etc. Schemas that are a part of the
getDbms().getType().getSchemaExcludSet()
set are excluded from
the model or that does not match the given filter will be excluded from
the Stream
.progressListener
- the progress listenerfilterCriteria
- criteria that schema names must fulfilldefault <T> Stream<T> executeQuery(String sql, SqlFunction<ResultSet,T> rsMapper)
empty
stream is returned.T
- the type of the objects in the stream to returnsql
- the SQL command to executersMapper
- the mapper to use when iterating over the ResultSet<T> Stream<T> executeQuery(String sql, List<?> values, SqlFunction<ResultSet,T> rsMapper)
ResultSet
using a provided mapper and return a stream of the
mapped objects. The ResultSet
is eagerly consumed. If no objects
are present or if an SQLException
is thrown internally, an
empty
stream is returned.T
- the type of the objects in the stream to returnsql
- the non-null SQL command to executevalues
- non-null values to use for "?" parameters in the sql
commandrsMapper
- the non-null mapper to use when iterating over the
ResultSet
<T> AsynchronousQueryResult<T> executeQueryAsync(String sql, List<?> values, Function<ResultSet,T> rsMapper)
ResultSet
using a provided mapper and return a stream of the
mapped objects. The ResultSet
is lazily consumed so that the
stream will consume the ResultSet
as the objects are consumed. If
no objects are present, an empty
stream is returned.T
- the type of the objects in the Stream to returnsql
- the non-null SQL command to executevalues
- non-null List of objects to use for "?" parameters in the
SQL commandrsMapper
- the non-null mapper to use when iterating over the
ResultSet
<F extends FieldTrait & ReferenceFieldTrait<?,?,?>> void executeInsert(String sql, List<?> values, List<F> generatedKeyFields, Consumer<List<Long>> generatedKeyConsumer) throws SQLException
F
- dynamic typesql
- the non-null SQL command to executevalues
- a non-null listgeneratedKeyFields
- list of the generated fieldsgeneratedKeyConsumer
- non-null List of objects to use for "?"
parameters in the SQL commandSQLException
- if an error occursvoid executeUpdate(String sql, List<?> values) throws SQLException
sql
- the non-null SQL command to executevalues
- a non-null listSQLException
- if an error occursvoid executeDelete(String sql, List<?> values) throws SQLException
sql
- the non-null SQL command to executevalues
- a non-null listSQLException
- if an error occursString getDbmsInfoString() throws SQLException
SQLException
- if an error occursCopyright © 2016 Speedment, Inc.. All rights reserved.