public interface ISqlGenerator
| Modifier and Type | Interface and Description |
|---|---|
static class |
ISqlGenerator.ESqlError |
static class |
ISqlGenerator.EStatementType |
| Modifier and Type | Method and Description |
|---|---|
String |
createSql(ISqlGenerator.EStatementType eStatement,
Row aMeta,
IDBBackendQuery iQuery)
create a new SQL statement for the given set of parameters.
|
Object |
getValueFromResultSet(ResultSet aResult,
String sColumn,
Class<?> aType)
extract an entity member value from the given result set.
|
String |
mapJavaTypeToSqlType(Column aMeta)
map the given Java type of an entity member to the corresponding SQL type
to be used within SQL statements.
|
ISqlGenerator.ESqlError |
mapSqlExceptionToError(SQLException aException)
map the given SQL exception to an suitable error code.
|
void |
setValueOnPreparedStatement(PreparedStatement aSql,
int nIndex,
Class<?> aType,
Object aValue)
set the given value on the also given PreparedStatement.
|
ISqlGenerator.ESqlError mapSqlExceptionToError(SQLException aException) throws Exception
aException - [IN]
the SQL exception to be 'translated' here.ExceptionString createSql(ISqlGenerator.EStatementType eStatement, Row aMeta, IDBBackendQuery iQuery) throws Exception
eStatement - [IN]
describe the requested SQL statement.aMeta - [IN]
all meta data describing the entity more in detail.iQuery - [IN, OPTIONAL]
describe a SQL query more in detail.
Can be null if no query is requested.ExceptionString mapJavaTypeToSqlType(Column aMeta) throws Exception
aMeta - [IN]
describe the entity member type.Exceptionvoid setValueOnPreparedStatement(PreparedStatement aSql, int nIndex, Class<?> aType, Object aValue) throws Exception
aSql - [IN, OUT]
the prepared statement where the value must be set.nIndex - [IN]
the position of the place holder which must be replaced
within the prepared statement.aType - [IN]
the java type of the given value.aValue - [IN]
the value to be set on the prepared statement.ExceptionObject getValueFromResultSet(ResultSet aResult, String sColumn, Class<?> aType) throws Exception
aResult - [IN]
the result set where the value must be read from.sColumn - [IN]
the column where the value must be read from.aType - [IN]
the java type of this value so it's casted right.ExceptionCopyright © 2016 as-development.net. All rights reserved.