public interface DbmsType
DbmsType
interface defines unique properties for different Dbms
types. By implementing a new DbmsType
and perhaps a new
DbmsHandler
, one may easily implement support for new Dbms vendor
types.Modifier and Type | Interface and Description |
---|---|
static class |
DbmsType.ConnectionType
The type of connection that this
DbmsType uses. |
static class |
DbmsType.SkipLimitSupport |
static class |
DbmsType.SortByNullOrderInsertion
The sort by null order insertion.
|
static class |
DbmsType.SubSelectAlias
The sub-select alias mode.
|
Modifier and Type | Field and Description |
---|---|
static Comparator<DbmsType> |
COMPARATOR |
Modifier and Type | Method and Description |
---|---|
String |
applySkipLimit(String originalSql,
List<Object> params,
long skip,
long limit)
Returns a new String and modifies the provided parameter list (side
effect) so that the original SQL query will reflect a query that has an
offset (skip) and a limit.
|
default SqlPredicateFragment |
getCollateFragment()
Returns the COLLATE fragment needed to make ORDER BY statements sort correctly, using default collation
|
DbmsColumnHandler |
getColumnHandler()
Returns the handler responsible for column inclusion/exclusion in queries
to databases
|
default DbmsType.ConnectionType |
getConnectionType()
Returns the connection type used in this
DbmsType . |
ConnectionUrlGenerator |
getConnectionUrlGenerator()
Returns the ConnectionUrlGenerator for this database.
|
DatabaseNamingConvention |
getDatabaseNamingConvention()
Returns the naming convention used by this database.
|
Set<TypeInfoMetaData> |
getDataTypes()
Returns a pre-defined Set for the TypeInfoMetaData for this database
type.
|
String |
getDbmsNameMeaning()
Returns a textual representation of what the database name is used for.
|
Optional<String> |
getDefaultDbmsName()
Returns the default name for this
DbmsType . |
int |
getDefaultPort()
Returns the default port for this
DbmsType . |
default Optional<String> |
getDefaultSchemaName()
Returns the default name for the
Schema when this
DbmsType is used. |
String |
getDriverManagerName()
Returns the non-null Driver Manager Name for this
DbmsType . |
String |
getDriverName()
Returns the non-null fully qualified JDBC class name for this
DbmsType . |
FieldPredicateView |
getFieldPredicateView()
Returns the FieldPredicateView for this database.
|
String |
getInitialQuery()
Returns the initial SQL connection verification query to send to the
database during speedment startup.
|
DbmsMetadataHandler |
getMetadataHandler()
Returns the handler responsible for loading the metadata when running
this type of database.
|
String |
getName()
Returns the non-null name for this
DbmsType . |
DbmsOperationHandler |
getOperationHandler()
Returns the handler responsible for running queries to databases of this
type.
|
String |
getResultSetTableSchema()
Returns the result set table schema.
|
String |
getSchemaTableDelimiter()
Returns the delimiter used between a Schema and a Table for this
DbmsType . |
DbmsType.SkipLimitSupport |
getSkipLimitSupport()
Returns the support for skip and limit (or skip and offset) for this
database type.
|
DbmsType.SortByNullOrderInsertion |
getSortByNullOrderInsertion()
Returns the SortByNullOrderInsertion mode for this database type.
|
DbmsType.SubSelectAlias |
getSubSelectAlias()
Returns the sub-select alias mode for this database type.
|
default boolean |
hasDatabaseNames()
Returns
true if this DbmsType uses named databases as
part of the database structure. |
default boolean |
hasDatabaseUsers()
|
default boolean |
hasSchemaNames()
Returns
true if this DbmsType uses named schemas as part
of the database structure. |
boolean |
isSupported()
Returns if this
DbmsType is supported by Speedment in the current
implementation. |
static final Comparator<DbmsType> COMPARATOR
String getName()
DbmsType
. For example MySQL or
OracleDbmsType
String getDriverManagerName()
DbmsType
. For
example "MySQL-AB JDBC Driver" or "Oracle JDBC Driver"int getDefaultPort()
DbmsType
. For example 3306
(MySQL) or 1521 (Oracle)String getSchemaTableDelimiter()
DbmsType
. Most DbmsType
are using a "." as a separator.String getDbmsNameMeaning()
Optional<String> getDefaultDbmsName()
DbmsType
. For example ‘orcl'
(Oracle)default Optional<String> getDefaultSchemaName()
Schema
when this
DbmsType
is used.default boolean hasSchemaNames()
true
if this DbmsType
uses named schemas as part
of the database structure. If false
, then the Speedment Config
model doesn't expect the HasName.getName()
to have any meaning
when referring to tables.
By default, this method returns true
.
true
if schema names are meaningful, else false
default boolean hasDatabaseNames()
true
if this DbmsType
uses named databases as
part of the database structure. If false
, then the Speedment
Config model doesn't expect the HasName.getName()
to have any
meaning when referring to tables.
By default, this method returns true
.
true
if dbms names are meaningful, else false
default boolean hasDatabaseUsers()
true
if this DbmsType
uses authentication with
username and password and false
otherwise. Some database managers
don't require authentication since they are only intended to be used for
tests or because security is handled at a different level.true
if authentication is supported, otherwise
false
boolean isSupported()
DbmsType
is supported by Speedment in the current
implementation.DbmsType
is supported by Speedment in the current
implementationString getDriverName()
DbmsType
. For example "com.mysql.jdbc.Driver" or
"oracle.jdbc.OracleDriver"DbmsType
default DbmsType.ConnectionType getConnectionType()
DbmsType
.DatabaseNamingConvention getDatabaseNamingConvention()
DbmsMetadataHandler getMetadataHandler()
DbmsMetadataHandler
DbmsOperationHandler getOperationHandler()
DbmsOperationHandler
DbmsColumnHandler getColumnHandler()
DbmsColumnHandler
String getResultSetTableSchema()
ConnectionUrlGenerator getConnectionUrlGenerator()
FieldPredicateView getFieldPredicateView()
Set<TypeInfoMetaData> getDataTypes()
String getInitialQuery()
default SqlPredicateFragment getCollateFragment()
DbmsType.SkipLimitSupport getSkipLimitSupport()
String applySkipLimit(String originalSql, List<Object> params, long skip, long limit)
originalSql
- original SQL queryparams
- parameter listskip
- number of rows to skip (OFFSET) (0 = no skip)limit
- number of rows to limit (Long.MAX_VALUE = no limit)DbmsType.SubSelectAlias getSubSelectAlias()
DbmsType.SortByNullOrderInsertion getSortByNullOrderInsertion()
Copyright © 2019 Speedment, Inc.. All rights reserved.