public final class Configuration extends Object
Modifier and Type | Field and Description |
---|---|
static Configuration |
DEFAULT |
Constructor and Description |
---|
Configuration(SQLTemplates templates)
Create a new Configuration instance
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(SQLListener listener) |
String |
asLiteral(Object o)
Get the literal representation of the given constant
|
<T> T |
get(ResultSet rs,
Path<?> path,
int i,
Class<T> clazz) |
String |
getColumnOverride(SchemaAndTable key,
String column)
Get the column override
|
Class<?> |
getJavaType(int sqlType,
int size,
int digits,
String tableName,
String columnName)
Deprecated.
|
Class<?> |
getJavaType(int sqlType,
String typeName,
int size,
int digits,
String tableName,
String columnName)
Get the java type for the given jdbc type, table name and column name
|
SQLListeners |
getListeners() |
SchemaAndTable |
getOverride(SchemaAndTable key)
Get the schema/table override
|
String |
getSchema(String schema)
Deprecated.
|
String |
getTable(String schema,
String table)
Deprecated.
|
SQLTemplates |
getTemplates() |
String |
getTypeName(Class<?> type)
Get the SQL type name for the given java type
|
String |
getTypeNameForCast(Class<?> type) |
boolean |
getUseLiterals() |
void |
register(String table,
String column,
Class<?> javaType)
Register the given javaType for the given table and column
|
void |
register(String table,
String column,
Type<?> type)
Register the given
Type converter for the given table and column |
void |
register(Type<?> type)
Register the given
Type converter |
String |
registerColumnOverride(String table,
String oldColumn,
String newColumn)
Register a column override
|
String |
registerColumnOverride(String schema,
String table,
String oldColumn,
String newColumn)
Register a column override
|
void |
registerNumeric(int total,
int decimal,
Class<?> javaType)
Override the binding for the given NUMERIC type
|
void |
registerNumeric(int beginTotal,
int endTotal,
int beginDecimal,
int endDecimal,
Class<?> javaType)
Override multiple numeric bindings, both begin and end are inclusive
|
String |
registerSchemaOverride(String oldSchema,
String newSchema)
Register a schema override
|
SchemaAndTable |
registerTableOverride(SchemaAndTable from,
SchemaAndTable to)
Register a schema specific table override
|
String |
registerTableOverride(String oldTable,
String newTable)
Register a table override
|
String |
registerTableOverride(String schema,
String oldTable,
String newTable)
Register a schema specific table override
|
SchemaAndTable |
registerTableOverride(String schema,
String oldTable,
String newSchema,
String newTable)
Register a schema specific table override
|
void |
registerType(String typeName,
Class<?> clazz)
Register a typeName to Class mapping
|
<T> void |
set(PreparedStatement stmt,
Path<?> path,
int i,
T value) |
void |
setExceptionTranslator(SQLExceptionTranslator exceptionTranslator) |
void |
setTemplates(SQLTemplates templates) |
void |
setUseLiterals(boolean useLiterals) |
RuntimeException |
translate(SQLException ex)
Translate the given SQLException
|
RuntimeException |
translate(String sql,
List<Object> bindings,
SQLException ex)
Translate the given SQLException
|
public static final Configuration DEFAULT
public Configuration(SQLTemplates templates)
templates
- public String asLiteral(Object o)
o
- public SQLTemplates getTemplates()
@Deprecated public Class<?> getJavaType(int sqlType, int size, int digits, String tableName, String columnName)
sqlType
- size
- digits
- tableName
- columnName
- public Class<?> getJavaType(int sqlType, String typeName, int size, int digits, String tableName, String columnName)
sqlType
- typeName
- size
- digits
- tableName
- columnName
- @Nullable public <T> T get(ResultSet rs, @Nullable Path<?> path, int i, Class<T> clazz) throws SQLException
T
- rs
- path
- i
- clazz
- SQLException
@Deprecated public String getSchema(String schema)
schema
- @Deprecated public String getTable(String schema, String table)
schema
- table
- @Nullable public SchemaAndTable getOverride(SchemaAndTable key)
key
- public String getColumnOverride(SchemaAndTable key, String column)
key
- column
- public <T> void set(PreparedStatement stmt, Path<?> path, int i, T value) throws SQLException
T
- stmt
- path
- i
- value
- SQLException
public String getTypeName(Class<?> type)
type
- public String registerSchemaOverride(String oldSchema, String newSchema)
oldSchema
- newSchema
- public String registerTableOverride(String oldTable, String newTable)
oldTable
- newTable
- public String registerTableOverride(String schema, String oldTable, String newTable)
schema
- oldTable
- newTable
- public SchemaAndTable registerTableOverride(String schema, String oldTable, String newSchema, String newTable)
schema
- oldTable
- newSchema
- newTable
- public SchemaAndTable registerTableOverride(SchemaAndTable from, SchemaAndTable to)
from
- to
- public String registerColumnOverride(String schema, String table, String oldColumn, String newColumn)
schema
- table
- oldColumn
- newColumn
- public String registerColumnOverride(String table, String oldColumn, String newColumn)
table
- oldColumn
- newColumn
- public void registerType(String typeName, Class<?> clazz)
typeName
- clazz
- public void registerNumeric(int total, int decimal, Class<?> javaType)
total
- total amount of digitsdecimal
- amount of fractional digitsjavaType
- public void registerNumeric(int beginTotal, int endTotal, int beginDecimal, int endDecimal, Class<?> javaType)
beginTotal
- endTotal
- beginDecimal
- endDecimal
- javaType
- public void register(String table, String column, Class<?> javaType)
table
- column
- javaType
- public void register(String table, String column, Type<?> type)
Type
converter for the given table and columntable
- column
- type
- public RuntimeException translate(SQLException ex)
ex
- public RuntimeException translate(String sql, List<Object> bindings, SQLException ex)
sql
- ex
- public void addListener(SQLListener listener)
listener
- public SQLListeners getListeners()
public boolean getUseLiterals()
public void setUseLiterals(boolean useLiterals)
useLiterals
- public void setExceptionTranslator(SQLExceptionTranslator exceptionTranslator)
exceptionTranslator
- public void setTemplates(SQLTemplates templates)
templates
- Copyright © 2007–2015 Mysema Ltd. All rights reserved.