LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.peer.sql.mysql
Class LyMySqlRequestEncoder

java.lang.Object
  extended by leon.peer.LyRequestEncoder
      extended by leon.peer.LyBlobRequestEncoder
          extended by leon.peer.sql.LySqlRequestEncoder
              extended by leon.peer.sql.mysql.LyMySqlRequestEncoder
All Implemented Interfaces:
LyJoinRequestEncoder

public class LyMySqlRequestEncoder
extends LySqlRequestEncoder

This class is used to send requests to a database connection and to receive its answers.

It uses an LySqlDataEncoder to encode and decode the values of requests and answers.

See Also:
LyRequestEncoder

Field Summary
static java.lang.String __VERSION
           
 
Fields inherited from class leon.peer.sql.LySqlRequestEncoder
CHAR_QUOTE, DOMAIN_FILTER_RELATION, STRING_QUOTE, STRING_TWO_QUOTES
 
Fields inherited from class leon.peer.LyBlobRequestEncoder
MAX_BLOB_BUFFER
 
Constructor Summary
LyMySqlRequestEncoder(LyDataProvider provider, LyDataSource dataSource, java.lang.String valueSep)
          Constructor.
 
Method Summary
 boolean createObject(java.lang.Object object)
          To create a new object.
 java.lang.String encodeLimitCondition(int limit)
          encode the limit condition
 java.lang.String getSQLFormatDate(java.lang.String quotedId, LyDateFieldInfo fieldInfo)
          String force formating date for order by using FORMAT(quotedId, 'YYYY-MM-DD HH:MM:SS') but syntax is specific depending on database vendor.
 void setResponse(LyResponse response)
          Set the request encoder response.
 
Methods inherited from class leon.peer.sql.LySqlRequestEncoder
buildObject, clearChildRequestInfo, completeSelectedFields, completeSelectedFields, deleteObject, deleteObjects, getFilters, getObject, getObjects, getObjects, getRequestInfo, getSize, getSize, getTableAliasForSelfTargetRelationClass, setChildRequestInfo, setObject, setObjects, setTrim, supportCaseSensitive
 
Methods inherited from class leon.peer.LyBlobRequestEncoder
getBlobContent
 
Methods inherited from class leon.peer.LyRequestEncoder
getClassBinding, getDataClass, getProvider, getResponse, isSynchronous, loadObject, setClassBinding, setDataClass, toString, toString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

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

LyMySqlRequestEncoder

public LyMySqlRequestEncoder(LyDataProvider provider,
                             LyDataSource dataSource,
                             java.lang.String valueSep)
Constructor.

Parameters:
classInfo - ClassInfo used by the sql request encoder.
Method Detail

createObject

public boolean createObject(java.lang.Object object)
To create a new object. Overriden to handle transactional handling of primary keys

Overrides:
createObject in class LySqlRequestEncoder
Parameters:
values - the values of the new object
Returns:
true if the request was correctly sent to the external data provider.

setResponse

public void setResponse(LyResponse response)
Set the request encoder response. Inherited method of LyRequestEncoder to set properties to the response.

Overrides:
setResponse in class LySqlRequestEncoder
Parameters:
the - response

encodeLimitCondition

public java.lang.String encodeLimitCondition(int limit)
encode the limit condition

Overrides:
encodeLimitCondition in class LySqlRequestEncoder
Parameters:
limit - max number of rows fetched

getSQLFormatDate

public java.lang.String getSQLFormatDate(java.lang.String quotedId,
                                         LyDateFieldInfo fieldInfo)
String force formating date for order by using FORMAT(quotedId, 'YYYY-MM-DD HH:MM:SS') but syntax is specific depending on database vendor. If not overridden this method does nothing and returns the quotedId to keep backward compatibility.

Overrides:
getSQLFormatDate in class LySqlRequestEncoder
Parameters:
quotedId - id of the date field (using aliases, table names and quotes if needed)
peerField - peer field related to this column
Returns:
the sort criteria to use in the SQL request

(c) January 2013 - W4 S.A.

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