org.objectweb.telosys.dal.dataset
Class SQLDataSetDefinition

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.dal.dataset.SQLDataSetDefinition

public class SQLDataSetDefinition
extends TelosysObject


Constructor Summary
SQLDataSetDefinition(java.lang.String sSqlSelectRequest)
          SQLDataSet definition constructor for full SQL request in a single string.
SQLDataSetDefinition(java.lang.String sSqlSelectRequest, int[] paramTypes)
          SQLDataSet definition constructor for full SQL request in a single string, with parameters.
SQLDataSetDefinition(java.lang.String sSqlSelect, java.lang.String sSqlFrom, java.lang.String sSqlWhere, java.lang.String sSqlOption)
          SQLDataSet definition constructor.
SQLDataSetDefinition(java.lang.String sSqlSelect, java.lang.String sSqlFrom, java.lang.String sSqlWhere, java.lang.String sSqlOption, int[] paramTypes)
          SQLDataSet definition constructor.
 
Method Summary
 void alterWhere(Criteria criterias)
          Change the initial SQL where clause using a criteria set to build the new WHERE clause dynamicaly NB: if the SQLDataSet definition is static, this method cannot be used ( throws a TelosysRuntimeException )
 java.lang.Object[] castParameters(java.lang.String[] strParams)
           
 int getDatabaseId()
           
 int getFirstRowForPage(int iPage)
          Return the first row of the given page (calculated with "lines per page")
 java.lang.String getFullSqlCount()
          Return the full SQL request for count(*)
 java.lang.String getFullSqlSelect()
          Return the full SQL request to retrieve data
 int getLastRowForPage(int iPage)
          Return the last row of the given page (calculated with "lines per page")
 int getLinesPerPage()
           
 int getMaxRows()
           
 int getNbParams()
          Return the number of parameters expected to execute the SQL request
 java.lang.String getParametersTypes()
           
 java.lang.String getSqlFrom()
           
 java.lang.String getSqlOption()
           
 java.lang.String getSqlSelect()
           
 java.lang.String getSqlWhere()
           
 void setDatabaseId(int v)
           
 void setLinesPerPage(int v)
           
 void setMaxRows(int v)
           
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLDataSetDefinition

public SQLDataSetDefinition(java.lang.String sSqlSelectRequest)
SQLDataSet definition constructor for full SQL request in a single string. NB: With this constructor, the WHERE clause cannot be dynamic ( alterWhere cannot be used )

Parameters:
sSqlSelectRequest -

SQLDataSetDefinition

public SQLDataSetDefinition(java.lang.String sSqlSelectRequest,
                            int[] paramTypes)
SQLDataSet definition constructor for full SQL request in a single string, with parameters. NB: With this constructor, the WHERE clause cannot be dynamic ( alterWhere cannot be used )

Parameters:
sSqlSelectRequest -
paramTypes -

SQLDataSetDefinition

public SQLDataSetDefinition(java.lang.String sSqlSelect,
                            java.lang.String sSqlFrom,
                            java.lang.String sSqlWhere,
                            java.lang.String sSqlOption)
SQLDataSet definition constructor. The WHERE clause is potentially dynamic ( alterWhere can be used )

Parameters:
sSqlSelect -
sSqlFrom -
sSqlWhere -
sSqlOption -

SQLDataSetDefinition

public SQLDataSetDefinition(java.lang.String sSqlSelect,
                            java.lang.String sSqlFrom,
                            java.lang.String sSqlWhere,
                            java.lang.String sSqlOption,
                            int[] paramTypes)
SQLDataSet definition constructor. The WHERE clause is potentially dynamic ( alterWhere can be used )

Parameters:
sSqlSelect -
sSqlFrom -
sSqlWhere -
sSqlOption -
paramTypes -
Method Detail

alterWhere

public void alterWhere(Criteria criterias)
Change the initial SQL where clause using a criteria set to build the new WHERE clause dynamicaly NB: if the SQLDataSet definition is static, this method cannot be used ( throws a TelosysRuntimeException )

Parameters:
criterias -

setMaxRows

public void setMaxRows(int v)

setLinesPerPage

public void setLinesPerPage(int v)

setDatabaseId

public void setDatabaseId(int v)

getSqlSelect

public java.lang.String getSqlSelect()

getSqlWhere

public java.lang.String getSqlWhere()

getSqlFrom

public java.lang.String getSqlFrom()

getSqlOption

public java.lang.String getSqlOption()

getNbParams

public int getNbParams()
Return the number of parameters expected to execute the SQL request

Returns:
: number of parameters expected

getLinesPerPage

public int getLinesPerPage()

getMaxRows

public int getMaxRows()

getDatabaseId

public int getDatabaseId()

getParametersTypes

public java.lang.String getParametersTypes()

getFullSqlCount

public java.lang.String getFullSqlCount()
Return the full SQL request for count(*)

Returns:
: SQL request

getFullSqlSelect

public java.lang.String getFullSqlSelect()
Return the full SQL request to retrieve data

Returns:
: SQL request

getFirstRowForPage

public int getFirstRowForPage(int iPage)
Return the first row of the given page (calculated with "lines per page")

Parameters:
iPage - : page number (from 1 to N )
Returns:
: the row number ( from 1 to N )

getLastRowForPage

public int getLastRowForPage(int iPage)
Return the last row of the given page (calculated with "lines per page")

Parameters:
iPage - : page number (from 1 to N )
Returns:
: the row number ( from 1 to N )

castParameters

public java.lang.Object[] castParameters(java.lang.String[] strParams)
                                  throws TelosysException
Throws:
TelosysException