|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaffa.persistence.engines.jdbcengine.querygenerator.DataTranslator
This class has helper routines for passing values in DML strings and PreparedStatements. There are routines to extract appropriate objects from ResultSets and CallableStatements.
| Method Summary | |
static Object |
getAppObject(CallableStatement cstmt,
int parameterIndex,
String typeName,
String engineType)
Gets a parameter from the CallableStatement. |
static Object |
getAppObject(ResultSet rs,
String columnName,
String typeName,
String engineType)
Gets a parameter from the ResultSet. |
static String |
getBeginsWithDml(Object object,
String typeName,
String engineType)
Returns the string to be used in SQL statements, appropriate for the datatype. |
static String |
getDml(Object object,
String typeName,
String engineType)
Returns the string to be used in SQL statements, appropriate for the datatype. |
static String |
getEndsWithDml(Object object,
String typeName,
String engineType)
Returns the string to be used in SQL statements, appropriate for the datatype. |
static String |
getLikeDml(Object object,
String typeName,
String engineType)
Returns the string to be used in SQL statements, appropriate for the datatype. |
static void |
setAppObject(PreparedStatement pstmt,
int parameterIndex,
Object value,
String typeName,
String engineType)
Sets a parameter in the PreparedStatement. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static String getDml(Object object,
String typeName,
String engineType)
throws IOException
object - an object for which the SQL statement is to be generated.typeName - The sqlType defined in the mapping file.engineType - The engine type as defined in init.xml
IOException - if any error occurs while extracting the String from the input object.
public static String getLikeDml(Object object,
String typeName,
String engineType)
throws IOException
object - an object for which the SQL statement is to be generated.typeName - The sqlType defined in the mapping file.engineType - The engine type as defined in init.xml
IOException - if any error occurs while extracting the String from the input object.
public static String getBeginsWithDml(Object object,
String typeName,
String engineType)
throws IOException
object - an object for which the SQL statement is to be generated.typeName - The sqlType defined in the mapping file.engineType - The engine type as defined in init.xml
IOException - if any error occurs while extracting the String from the input object.
public static String getEndsWithDml(Object object,
String typeName,
String engineType)
throws IOException
object - an object for which the SQL statement is to be generated.typeName - The sqlType defined in the mapping file.engineType - The engine type as defined in init.xml
IOException - if any error occurs while extracting the String from the input object.
public static void setAppObject(PreparedStatement pstmt,
int parameterIndex,
Object value,
String typeName,
String engineType)
throws SQLException
pstmt - The PreparedStatement.parameterIndex - The index of the parameter that is to be set.value - The object to be assigned to the parameter.typeName - The sqlType defined in the mapping file.engineType - The engine type as defined in init.xml
SQLException - if a database access error occurs.
public static Object getAppObject(ResultSet rs,
String columnName,
String typeName,
String engineType)
throws SQLException,
IOException
rs - The ResultSet.columnName - The name of the parameter.engineType - The engine type as defined in init.xmltypeName - The sqlType defined in the mapping file.
SQLException - if a database access error occurs.
IOException - if any error occurs in reading the data from the database.
public static Object getAppObject(CallableStatement cstmt,
int parameterIndex,
String typeName,
String engineType)
throws SQLException,
IOException
cstmt - The CallableStatement.parameterIndex - The index of the parameter.engineType - The engine type as defined in init.xmltypeName - The sqlType defined in the mapping file.
SQLException - if a database access error occurs.
IOException - if any error occurs in reading the data from the database.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||