com.stratelia.webactiv.beans.admin
Class SQLRequest

java.lang.Object
  extended by com.stratelia.webactiv.beans.admin.SQLRequest
Direct Known Subclasses:
ContactInstanciator, CoordinatesInstanciator, NodeInstanciator, PublicationInstanciator, QuestionContainerInstanciator, QuestionInstanciator, ThumbnailInstanciator, WysiwygInstanciator

public class SQLRequest
extends Object

The SQLRequest class allows a component to get a SQL request in order by the server type (SQLServer, Oracle, PostgreSQL,...). The role of this class is to read a specific property file (create, delete, update, insert), to extract the specific SQL code with specific tag. And to return the complet rigth SQL code.


Constructor Summary
SQLRequest()
           
SQLRequest(String fullPathName)
           
SQLRequest(String fullPathName, String dbServerName)
           
 
Method Summary
protected  String getCreateQuery(String tableName, String tableType)
          Returns the complete SQL query which allows the administrator to create a table.
protected  String getDeleteQuery(String instanceId, String tableType)
          Returns the complete SQL query which allows the administrator to delete some rows into table.
protected  String getInsertQuery(String instanceId, String tableType)
          Returns the complete SQL query which allows the administrator to insert data into tables.
protected  String getUpdateQuery(String instanceId, String tableType)
          Returns the complete SQL query which allows the administrator to update a table.
protected  void setCreateQueries()
          Set create SQL file into the allQueries String
protected  void setDeleteQueries()
          Set delete SQL file into the allQueries String
protected  void setInsertQueries()
          Set insert SQL file into the allQueries String
protected  void setUpdateQueries()
          Set update SQL file into the allQueries String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLRequest

public SQLRequest(String fullPathName,
                  String dbServerName)

SQLRequest

public SQLRequest(String fullPathName)

SQLRequest

public SQLRequest()
Method Detail

setCreateQueries

protected void setCreateQueries()
Set create SQL file into the allQueries String


setDeleteQueries

protected void setDeleteQueries()
Set delete SQL file into the allQueries String


setInsertQueries

protected void setInsertQueries()
Set insert SQL file into the allQueries String


setUpdateQueries

protected void setUpdateQueries()
Set update SQL file into the allQueries String


getCreateQuery

protected String getCreateQuery(String tableName,
                                String tableType)
Returns the complete SQL query which allows the administrator to create a table.

Parameters:
tableName - (String) the name of the created table
tableType - (String) the type of the table which must be created (forum, rights, message, event, ...)
Returns:
the complete SQL query to create a table

getDeleteQuery

protected String getDeleteQuery(String instanceId,
                                String tableType)
Returns the complete SQL query which allows the administrator to delete some rows into table.

Parameters:
instanceId - (String) the name of the created table
tableType - (String) the type of the table which must be created (forum, rights, message, event, ...)
Returns:
the complete SQL query to delete a table

getUpdateQuery

protected String getUpdateQuery(String instanceId,
                                String tableType)
Returns the complete SQL query which allows the administrator to update a table.

Parameters:
instanceId - (String) the id of the component where their data must be updated into tables.
tableType - (String) the type of the table which must be created (forum, rights, message, event, ...)
Returns:
the complete SQL query to update a table

getInsertQuery

protected String getInsertQuery(String instanceId,
                                String tableType)
Returns the complete SQL query which allows the administrator to insert data into tables.

Parameters:
instanceId - (String) the id of the component where their data must be inserted into tables.
tableType - (String) the type of the table which must be created (forum, rights, message, event, ...)
Returns:
the complete SQL query to insert a table


Copyright © 2016 Silverpeas. All Rights Reserved.