LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.peer.sql
Interface LySqlSpecificEncoder


public interface LySqlSpecificEncoder

This class is used to encode and decode specific values for a SQL location. Instances of this class must be register in LySqlDataProvider with the method addSpecificEncoder(LyField, LySqlSpecificEncoder) in the application behavior method registerSpecificEncoders.

See Also:
LySqlRequestEncoder, LySqlConnection, LySqlDataProvider, LyDataApplicationBehavior

Field Summary
static java.lang.String __VERSION
           
 
Method Summary
 java.lang.Object getPeerValue(java.sql.ResultSet rs, LyField field, int index, java.lang.Class<?> valueClass)
          To decode a value given by the RDBMS.
 java.lang.String getSqlValue(LyField field, java.lang.Object value)
          To encode a specific value for the specified peer field.
 

Field Detail

__VERSION

static final java.lang.String __VERSION
See Also:
Constant Field Values
Method Detail

getSqlValue

java.lang.String getSqlValue(LyField field,
                             java.lang.Object value)
To encode a specific value for the specified peer field.

Parameters:
field - The field for which we want to encode the value.
value - The value to encode. The class of this object depends on internal representation of values for the field. It will be java.util.Date, Object[] or String.
Returns:
The string representation of the value that will be inserted in the sql request sent to the RDBMS.

getPeerValue

java.lang.Object getPeerValue(java.sql.ResultSet rs,
                              LyField field,
                              int index,
                              java.lang.Class<?> valueClass)
                              throws LySqlUnsupportedConversionException,
                                     java.sql.SQLException
To decode a value given by the RDBMS.

Parameters:
rs - The ResultSet that contains the value to decode.
field - The field for which we want to decode the value.
index - The position of the column in the ResultSet.
valueClass - The class of the result.
Returns:
The object of the given class representing the decoded value.
Throws:
LySqlUnsupportedConversionException
java.sql.SQLException

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com