Package org.dalesbred.dialect
Class Dialect
java.lang.Object
org.dalesbred.dialect.Dialect
- Direct Known Subclasses:
DefaultDialect,H2Dialect,HsqldbDialect,MariaDBDialect,MySQLDialect,OracleDialect,PostgreSQLDialect,SQLServerDialect
Abstracts away the differences of databases.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbindArgument(@NotNull PreparedStatement ps, int index, @Nullable Object value) Bind object toPreparedStatement.@NotNull DatabaseExceptionconvertException(@NotNull SQLException e) <T extends Enum<T>,K>
@NotNull TypeConversionPair<Object, T> createNativeEnumConversions(@NotNull Class<T> enumType, @NotNull String typeName, @NotNull Function<T, K> keyFunction) static @NotNull Dialectdetect(@NotNull Connection connection) static @NotNull Dialectdetect(@NotNull DataSource dataSource) static @NotNull Dialectdetect(@NotNull ConnectionProvider connectionProvider) static @NotNull Dialectdetect(@NotNull TransactionManager transactionManager) @Nullable TypeoverrideResultSetMetaDataType(@NotNull String className) voidregisterTypeConversions(@NotNull TypeConversionRegistry typeConversionRegistry) @NotNull StringtoString()@NotNull ObjectvalueToDatabase(@NotNull Object value)
-
Constructor Details
-
Dialect
public Dialect()
-
-
Method Details
-
valueToDatabase
-
createNativeEnumConversions
-
toString
-
detect
-
detect
@NotNull public static @NotNull Dialect detect(@NotNull @NotNull TransactionManager transactionManager) -
detect
@NotNull public static @NotNull Dialect detect(@NotNull @NotNull ConnectionProvider connectionProvider) -
detect
-
convertException
-
registerTypeConversions
public void registerTypeConversions(@NotNull @NotNull TypeConversionRegistry typeConversionRegistry) -
bindArgument
public void bindArgument(@NotNull @NotNull PreparedStatement ps, int index, @Nullable @Nullable Object value) throws SQLException Bind object toPreparedStatement. Can be overridden by subclasses to implement custom argument binding.- Parameters:
ps- statement to bind object toindex- index of the parametervalue- to bind- Throws:
SQLException- if something fails
-
overrideResultSetMetaDataType
-