Package org.dalesbred.dialect
Class Dialect
- java.lang.Object
-
- org.dalesbred.dialect.Dialect
-
- Direct Known Subclasses:
DefaultDialect,H2Dialect,HsqldbDialect,MariaDBDialect,MySQLDialect,OracleDialect,PostgreSQLDialect,SQLServerDialect
public abstract class Dialect extends java.lang.ObjectAbstracts away the differences of databases.
-
-
Constructor Summary
Constructors Constructor Description Dialect()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindArgument(@NotNull java.sql.PreparedStatement ps, int index, @Nullable java.lang.Object value)Bind object toPreparedStatement.@NotNull DatabaseExceptionconvertException(@NotNull java.sql.SQLException e)<T extends java.lang.Enum<T>,K>
@NotNull TypeConversionPair<java.lang.Object,T>createNativeEnumConversions(@NotNull java.lang.Class<T> enumType, @NotNull java.lang.String typeName, @NotNull java.util.function.Function<T,K> keyFunction)static @NotNull Dialectdetect(@NotNull java.sql.Connection connection)static @NotNull Dialectdetect(@NotNull javax.sql.DataSource dataSource)static @NotNull Dialectdetect(@NotNull ConnectionProvider connectionProvider)static @NotNull Dialectdetect(@NotNull TransactionManager transactionManager)@Nullable java.lang.reflect.TypeoverrideResultSetMetaDataType(@NotNull java.lang.String className)voidregisterTypeConversions(@NotNull TypeConversionRegistry typeConversionRegistry)@NotNull java.lang.StringtoString()@NotNull java.lang.ObjectvalueToDatabase(@NotNull java.lang.Object value)
-
-
-
Method Detail
-
valueToDatabase
@NotNull public @NotNull java.lang.Object valueToDatabase(@NotNull @NotNull java.lang.Object value)
-
createNativeEnumConversions
@NotNull public <T extends java.lang.Enum<T>,K> @NotNull TypeConversionPair<java.lang.Object,T> createNativeEnumConversions(@NotNull @NotNull java.lang.Class<T> enumType, @NotNull @NotNull java.lang.String typeName, @NotNull @NotNull java.util.function.Function<T,K> keyFunction)
-
toString
@NotNull public @NotNull java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
detect
@NotNull public static @NotNull Dialect detect(@NotNull @NotNull javax.sql.DataSource dataSource)
-
detect
@NotNull public static @NotNull Dialect detect(@NotNull @NotNull TransactionManager transactionManager)
-
detect
@NotNull public static @NotNull Dialect detect(@NotNull @NotNull ConnectionProvider connectionProvider)
-
detect
@NotNull public static @NotNull Dialect detect(@NotNull @NotNull java.sql.Connection connection)
-
convertException
@NotNull public @NotNull DatabaseException convertException(@NotNull @NotNull java.sql.SQLException e)
-
registerTypeConversions
public void registerTypeConversions(@NotNull @NotNull TypeConversionRegistry typeConversionRegistry)
-
bindArgument
public void bindArgument(@NotNull @NotNull java.sql.PreparedStatement ps, int index, @Nullable @Nullable java.lang.Object value) throws java.sql.SQLExceptionBind 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:
java.sql.SQLException- if something fails
-
overrideResultSetMetaDataType
@Nullable public @Nullable java.lang.reflect.Type overrideResultSetMetaDataType(@NotNull @NotNull java.lang.String className)
-
-