LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.peer.sql
Class LySqlDataProvider

java.lang.Object
  extended by leon.peer.LyDataProvider
      extended by leon.peer.LyPeerDataProvider
          extended by leon.peer.util.LyTableDataProvider
              extended by leon.peer.sql.LySqlDataProvider
All Implemented Interfaces:
LyJoinDataProvider
Direct Known Subclasses:
LyAccessDataProvider, LyHsqldbDataProvider, LyIdbDataProvider, LyMySqlDataProvider, LyPostgresqlDataProvider

public class LySqlDataProvider
extends LyTableDataProvider
implements LyJoinDataProvider

This class is used by DataSources to transmit their requests to an instance of SqlRequestEncoder.

See Also:
LyDataProvider, LySqlRequestEncoder, LySqlConnection

Field Summary
static java.lang.String __VERSION
           
static java.lang.String DATASOURCE_NAME
          Constant for datasource name parameter in the property file.
 
Constructor Summary
LySqlDataProvider(LyApplication application, LyLocation location)
          Default constructor.
 
Method Summary
 void addSpecificEncoder(LyField field, LySqlSpecificEncoder encoder)
          Register a specific encoder for the given field.
 boolean endValidate()
          This method is used to build all the class peers for all the classInfo.
 LyJoinRequestEncoder getJoinRequestEncoder(LyDataSource dataSource)
          Create a specific join request encoder for the specified dataSource.
 LyRequestEncoder getRequestEncoder(LyDataSource dataSource)
          Create a specific request encoder for the specified dataSource.
 java.util.ArrayList<java.lang.String> getTableNames()
          Access data provider, only to get table names
 boolean isXASupported()
          Tests if this data provider supports the XA protocol or not.
 void setLocation(LyLocation location)
          Sets location on this provider.
 void setTrim(boolean trim)
          Modifier of the trim member.
 java.lang.Object writeMetaData()
          This method is use for get LyMetadataInformations.
 java.lang.Object writeMetaData(java.util.List<java.lang.String> tableNames)
          This method is use for get LyMetadataInformations.
 
Methods inherited from class leon.peer.LyPeerDataProvider
getPeerClass, invalidate, load, resetPeerClasses, validate, validate, validateNotifier
 
Methods inherited from class leon.peer.LyDataProvider
canBeFullyLoaded, close, dumpConnections, getApplication, getConnection, getEnvironment, getEventNotifier, getId, getLocation, getNbAvailableConnection, getNbConnection, hasLostConnection, isConnectionReady, isModified, isModified, isNotifierReady, releaseConnection, save, setEventNotifier, setModified, setNbConnection, sleep, validate, wakeUp
 
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

DATASOURCE_NAME

public static final java.lang.String DATASOURCE_NAME
Constant for datasource name parameter in the property file.

See Also:
Constant Field Values
Constructor Detail

LySqlDataProvider

public LySqlDataProvider(LyApplication application,
                         LyLocation location)
Default constructor. Initialization is done with the init method.

Parameters:
application - the application of this provider.
location - the info location defining this provider.
Method Detail

setLocation

public void setLocation(LyLocation location)
Sets location on this provider.

Overrides:
setLocation in class LyDataProvider
Parameters:
location - New location for the provider.

setTrim

public void setTrim(boolean trim)
Modifier of the trim member.

Parameters:
trim - true to trim all values provided by the database, false otherwise.

endValidate

public boolean endValidate()
This method is used to build all the class peers for all the classInfo. It must be specialized by subclasses. Basically, this method associates the dataProvider with local classes. A class is local if there is no binding.

Returns:
true if the end of validation is OK, false otherwise.
See Also:
LyEventNotifier.validate(leon.info.LyInfoList)

getRequestEncoder

public LyRequestEncoder getRequestEncoder(LyDataSource dataSource)
Create a specific request encoder for the specified dataSource.

Specified by:
getRequestEncoder in class LyDataProvider
Parameters:
dataSource - reference to the dataSource associated to this request encoder.
Returns:
the specific LyRequestEncoder for the specified dataSource.

getJoinRequestEncoder

public LyJoinRequestEncoder getJoinRequestEncoder(LyDataSource dataSource)
Create a specific join request encoder for the specified dataSource.

Specified by:
getJoinRequestEncoder in interface LyJoinDataProvider
Parameters:
dataSource - reference to the dataSource associated to this request encoder.
Returns:
the specific LyRequestEncoder for the specified dataSource.

getTableNames

public java.util.ArrayList<java.lang.String> getTableNames()
Access data provider, only to get table names

Parameters:
metaData - metaData for the current database
Returns:
table names

writeMetaData

public java.lang.Object writeMetaData()
This method is use for get LyMetadataInformations.

Returns:
Object LyMetaDataInformation of this database

writeMetaData

public java.lang.Object writeMetaData(java.util.List<java.lang.String> tableNames)
This method is use for get LyMetadataInformations.

Parameters:
tableNames - Names of the tables to discover
Returns:
Object LyMetaDataInformation of this database

addSpecificEncoder

public void addSpecificEncoder(LyField field,
                               LySqlSpecificEncoder encoder)
Register a specific encoder for the given field.

Parameters:
field - The field for which the encoder is registered.
encoder - The specific encoder to register.

isXASupported

public boolean isXASupported()
Tests if this data provider supports the XA protocol or not. A SQL provider supports the XA protocol if a JDBC DataSource is defined for this provider ad if this DataSource is a XADataSource.

Overrides:
isXASupported in class LyDataProvider
Returns:
true if this provider supports the XA protocol, false otherwise.

(c) January 2013 - W4 S.A.

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