Package org.tentackle.sql
package org.tentackle.sql
The SQL backend layer.
Isolates the upper layers from the dialect, quirks and capabilities of the concrete database.
The central abstraction is the Backend, one per kind of database,
located via the BackendFactory. A BackendInfo
describes a concrete connection target. The DataTypes map the Java types
of the model to one or more columns of a SqlType.
Furthermore, the package provides the ScriptRunner to execute SQL scripts
and the DynamicDriver to load JDBC drivers at runtime.
-
ClassDescriptionA database backend.
Defines the backend specifics.
There is only one instance per backend type.
Implementations must not maintain any state except for the whole of all connections to the specific kind of database.Runtime exception thrown for backend-related errors, such as configuration errors, invalid names, unsupported database versions or failed scripts.The backend factory.
Provides the backend singletons, one per backend type, discovered asBackendservices.Configuration info for a backend.
Describes a concrete connection target, as opposed to theBackend, which describes a kind of database.The backend info factory.Backend-facing view of a prepared statement.
Implemented by thePreparedStatementWrapperof the persistence layer, so that backends and data types can set parameters without depending on it.The version of a backend's database, as reported by its JDBC driver metadata.DataType<T>The data type.
Describes a type from the model perspective and maps it to one or moreSqlTypes, each corresponding to a database column.Loads all data types and creates singletons of each type.Default implementation of a backend factory.Default implementation of a backend info factory.Default implementation ofDataTypeFactory.Default implementation of a script runner.The next SQL code to execute as a statement.Loads a JDBC driver dynamically at runtime via a URL.
Because DriverManager will refuse to use a driver not loaded by the system-classloader, we must wrap the URL-loaded driver by such a class.Defines the methods to use for migration.Holds non-SQL-standard common features supported by most backends.SQL script runner.
Splits a script into statements according to the backend's statement separator and comment syntax, and executes them one by one.Runtime exception thrown when aScriptRunnerencounters an error.The result of a statement executed by aScriptRunner.
Results with warnings only (no SQL code) report the warnings of the connection or a failure while terminating the script.The kind of an SQL identifier.
Used to validate names (seeBackend.assertValidName(SqlNameType, String)) and to determine their maximum length (seeBackend.getMaxNameLength(SqlNameType)).The SQL types used when talking to the database backend.