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

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

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

PostgresSQL request

Author:
AKKA [3419661]
2011-Oct-07 D.Arpin {Add double quotes arround schema name when requesting a table}

Constructor Summary
RequestPostgres()
           
 
Method Summary
 java.lang.String convertColumnToString(Column attribute)
          Get the SQL string corresponding to a column without alias
 java.lang.String convertColumnToStringAttribute(Column attribute)
          build the the attributes of a Select query
 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 getFromClause(java.util.List<Structure> structures)
          Get from clause
 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 tableToString(Table table)
          Transform a table to a string
 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

RequestPostgres

public RequestPostgres()
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

tableToString

public java.lang.String tableToString(Table table)
Transform a table to a string

Parameters:
table - the table to transform
Returns:
table signature in sql request

getFromClause

public java.lang.String getFromClause(java.util.List<Structure> structures)
Get from clause

Parameters:
structures - a list of structures
Returns:
the clause

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

convertColumnToStringAttribute

public java.lang.String convertColumnToStringAttribute(Column attribute)
build the the attributes of a Select query

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

convertColumnToString

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

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

getFromClauseAdvanced

public java.lang.String getFromClauseAdvanced(SitoolsStructure structure)
Description copied from interface: RequestSql
Get from clause

Specified by:
getFromClauseAdvanced in interface RequestSql
Parameters:
structure - a 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


Copyright © 2010-2013 CNES. All Rights Reserved.