fr.cnes.sitools.dataset.database.jdbc
Class RequestMysql

java.lang.Object
  extended by fr.cnes.sitools.dataset.database.jdbc.RequestMysql
All Implemented Interfaces:
RequestSql

public final class RequestMysql
extends java.lang.Object
implements RequestSql

MySQL request

Author:
AKKA

Constructor Summary
RequestMysql()
           
 
Method Summary
 java.lang.String convertColumnToString(Column attribute)
          Get the SQL string corresponding to a column
 java.lang.String convertColumnToStringAttribute(Column attribute)
          Built the left part of the filter SQL
 java.lang.String convertOperator(java.lang.String compareOperator)
          convert a operator to a SQL operator
 java.lang.String getAttributes(java.util.List<Column> columnVisible)
          Get the attributes of the request
 java.lang.String getFilter(Predicat predicat)
          Convert a predicate to a SQL filter
 java.lang.String getFromClauseAdvanced(SitoolsStructure structure)
          Get from clause
 java.lang.String getNodeFrom(java.util.List<StructureNodeComplete> nodeList, int level, java.lang.String parentheseFermante)
          Get the node from the node list, the level and the closing parenthesis
 java.lang.String getOrderBy(DataSet ds)
          Get the order by defined
 java.lang.String getWhereClause(java.util.List<Predicat> predicats, java.util.List<Column> columns)
          Get the WHERE clause
 java.lang.String typeJointureToString(TypeJointure typeJointure)
          Transform a join type to string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestMysql

public RequestMysql()
Method Detail

getAttributes

public java.lang.String getAttributes(java.util.List<Column> columnVisible)
Get the attributes of the request

Specified by:
getAttributes in interface RequestSql
Parameters:
columnVisible - list of visible columns
Returns:
attributes

getFromClauseAdvanced

public java.lang.String getFromClauseAdvanced(SitoolsStructure structure)
Get from clause

Specified by:
getFromClauseAdvanced in interface RequestSql
Parameters:
structure - the sitoolsStructure
Returns:
the clause

getNodeFrom

public java.lang.String getNodeFrom(java.util.List<StructureNodeComplete> nodeList,
                                    int level,
                                    java.lang.String parentheseFermante)
Description copied from interface: RequestSql
Get the node from the node list, the level and the closing parenthesis

Specified by:
getNodeFrom in interface RequestSql
Parameters:
nodeList - the list of nodes
level - the level
parentheseFermante - the closing parenthesis
Returns:
The node

typeJointureToString

public java.lang.String typeJointureToString(TypeJointure typeJointure)
Description copied from interface: RequestSql
Transform a join type to string

Specified by:
typeJointureToString in interface RequestSql
Parameters:
typeJointure - the join type
Returns:
the corresponding string for the implemented request type

getWhereClause

public java.lang.String getWhereClause(java.util.List<Predicat> predicats,
                                       java.util.List<Column> columns)
Get the WHERE clause

Specified by:
getWhereClause in interface RequestSql
Parameters:
predicats - a list of predicates
columns - a list of columns
Returns:
the WHERE clause

getFilter

public java.lang.String getFilter(Predicat predicat)
Convert a predicate to a SQL filter

Specified by:
getFilter in interface RequestSql
Parameters:
predicat - the predicate
Returns:
the filter

convertOperator

public java.lang.String convertOperator(java.lang.String compareOperator)
convert a operator to a SQL operator

Parameters:
compareOperator - the operator
Returns:
the SQL operator

convertColumnToStringAttribute

public java.lang.String convertColumnToStringAttribute(Column attribute)
Built the left part of the filter SQL

Specified by:
convertColumnToStringAttribute in interface RequestSql
Parameters:
attribute - the column
Returns:
the left part of SQL filter

convertColumnToString

public java.lang.String convertColumnToString(Column attribute)
Get the SQL string corresponding to a column

Specified by:
convertColumnToString in interface RequestSql
Parameters:
attribute - the column to convert
Returns:
the column convert to string

getOrderBy

public java.lang.String getOrderBy(DataSet ds)
Description copied from interface: RequestSql
Get the order by defined

Specified by:
getOrderBy in interface RequestSql
Parameters:
ds - the primary keys defined in the request
Returns:
the ORDER BY clause


Copyright © 2010-2013 CNES. All Rights Reserved.