| java.lang.Object org.jaffa.persistence.engines.jdbcengine.querygenerator.DataTranslator
DataTranslator | public class DataTranslator (Code) | | 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 | |
public static Object | getAppObject(ResultSet rs, String columnName, String typeName, String engineType) Gets a parameter from the ResultSet. | public static Object | getAppObject(CallableStatement cstmt, int parameterIndex, String typeName, String engineType) Gets a parameter from the CallableStatement. | public static String | getBeginsWithDml(Object object, String typeName, String engineType) Returns the string to be used in SQL statements, appropriate for the datatype. | public static String | getDml(Object object, String typeName, String engineType) Returns the string to be used in SQL statements, appropriate for the datatype. | public static String | getEndsWithDml(Object object, String typeName, String engineType) Returns the string to be used in SQL statements, appropriate for the datatype. | public static String | getLikeDml(Object object, String typeName, String engineType) Returns the string to be used in SQL statements, appropriate for the datatype. | public static void | setAppObject(PreparedStatement pstmt, int parameterIndex, Object value, String typeName, String engineType) Sets a parameter in the PreparedStatement. |
getAppObject | public static Object getAppObject(ResultSet rs, String columnName, String typeName, String engineType) throws SQLException, IOException(Code) | | Gets a parameter from the ResultSet.
Parameters: rs - The ResultSet. Parameters: columnName - The name of the parameter. Parameters: engineType - The engine type as defined in init.xml the parameter. Parameters: typeName - The sqlType defined in the mapping file. throws: SQLException - if a database access error occurs. throws: IOException - if any error occurs in reading the data from the database. |
getAppObject | public static Object getAppObject(CallableStatement cstmt, int parameterIndex, String typeName, String engineType) throws SQLException, IOException(Code) | | Gets a parameter from the CallableStatement.
Parameters: cstmt - The CallableStatement. Parameters: parameterIndex - The index of the parameter. Parameters: engineType - The engine type as defined in init.xml the parameter. Parameters: typeName - The sqlType defined in the mapping file. throws: SQLException - if a database access error occurs. throws: IOException - if any error occurs in reading the data from the database. |
getBeginsWithDml | public static String getBeginsWithDml(Object object, String typeName, String engineType) throws IOException(Code) | | Returns the string to be used in SQL statements, appropriate for the datatype.
Parameters: object - an object for which the SQL statement is to be generated. Parameters: typeName - The sqlType defined in the mapping file. Parameters: engineType - The engine type as defined in init.xml the string to be used in SQL statements, appropriate for the datatype. throws: IOException - if any error occurs while extracting the String from the input object. |
getDml | public static String getDml(Object object, String typeName, String engineType) throws IOException(Code) | | Returns the string to be used in SQL statements, appropriate for the datatype.
Parameters: object - an object for which the SQL statement is to be generated. Parameters: typeName - The sqlType defined in the mapping file. Parameters: engineType - The engine type as defined in init.xml the string to be used in SQL statements, appropriate for the datatype. throws: IOException - if any error occurs while extracting the String from the input object. |
getEndsWithDml | public static String getEndsWithDml(Object object, String typeName, String engineType) throws IOException(Code) | | Returns the string to be used in SQL statements, appropriate for the datatype.
Parameters: object - an object for which the SQL statement is to be generated. Parameters: typeName - The sqlType defined in the mapping file. Parameters: engineType - The engine type as defined in init.xml the string to be used in SQL statements, appropriate for the datatype. throws: IOException - if any error occurs while extracting the String from the input object. |
getLikeDml | public static String getLikeDml(Object object, String typeName, String engineType) throws IOException(Code) | | Returns the string to be used in SQL statements, appropriate for the datatype.
Parameters: object - an object for which the SQL statement is to be generated. Parameters: typeName - The sqlType defined in the mapping file. Parameters: engineType - The engine type as defined in init.xml the string to be used in SQL statements, appropriate for the datatype. throws: IOException - if any error occurs while extracting the String from the input object. |
setAppObject | public static void setAppObject(PreparedStatement pstmt, int parameterIndex, Object value, String typeName, String engineType) throws SQLException(Code) | | Sets a parameter in the PreparedStatement.
Parameters: pstmt - The PreparedStatement. Parameters: parameterIndex - The index of the parameter that is to be set. Parameters: value - The object to be assigned to the parameter. Parameters: typeName - The sqlType defined in the mapping file. Parameters: engineType - The engine type as defined in init.xml throws: SQLException - if a database access error occurs. |
|
|