Package org.dalesbred.dialect
Class Dialect
java.lang.Object
org.dalesbred.dialect.Dialect
- Direct Known Subclasses:
DefaultDialect
,H2Dialect
,HsqldbDialect
,MySQLDialect
,OracleDialect
,PostgreSQLDialect
,SQLServerDialect
Abstracts away the differences of databases.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
bindArgument
(@NotNull PreparedStatement ps, int index, @Nullable Object value) Bind object toPreparedStatement
.@NotNull DatabaseException
convertException
(@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 Dialect
detect
(@NotNull Connection connection) static @NotNull Dialect
detect
(@NotNull DataSource dataSource) static @NotNull Dialect
detect
(@NotNull ConnectionProvider connectionProvider) static @NotNull Dialect
detect
(@NotNull TransactionManager transactionManager) void
registerTypeConversions
(@NotNull TypeConversionRegistry typeConversionRegistry) @NotNull String
toString()
@NotNull Object
valueToDatabase
(@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
-