org.ow2.petals.flowwatch.flowmanager
Class AbstractCreateSQLQuery

java.lang.Object
  extended by org.ow2.petals.flowwatch.flowmanager.AbstractCreateSQLQuery
Direct Known Subclasses:
CreateSqlQueryFlow, CreateSqLQueryFlowWithParams

public abstract class AbstractCreateSQLQuery
extends java.lang.Object

Author:
ofabre

Constructor Summary
AbstractCreateSQLQuery()
           
 
Method Summary
protected  java.lang.String getFlowRefLeftJoinByType(java.lang.String type)
          Add the flow ref join clause.
protected  java.lang.String getFlowRefLeftJoinGlobal()
          Add the flow ref join clause.
protected  java.lang.String getFrom()
          Add the "from" clause
protected  java.lang.String getGlobalOrderBy()
          A generic order by method used to order flow when no sort option selected
protected  java.lang.String getLastStepLeftJoin()
          Add the flow step ref and corresponding flow step left join clause.
protected  java.lang.String getLimit(int indxFirst, int rowsPerPage)
          Add the "limit" clause.
protected  java.lang.String getMySQLFilterType(Filter.FilterType type, java.lang.String value)
          Return the mysql operator for a given filter type
protected abstract  java.lang.String getSelectByAttribute()
           
protected  java.lang.String getSelectForCount()
          A "select" clause to count all rows of a specific request
protected  java.lang.String getStartStepLeftJoin()
          Add the flow step ref and corresponding flow step left join clause.
protected abstract  java.lang.String sort(int idxColumn, java.lang.String sortType)
           
protected  java.lang.String sortAsc(int idxColumn)
          Add "order by" clause.
protected  java.lang.String sortDesc(int idxColumn)
          Add "order by" clause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCreateSQLQuery

public AbstractCreateSQLQuery()
Method Detail

getSelectByAttribute

protected abstract java.lang.String getSelectByAttribute()

getSelectForCount

protected java.lang.String getSelectForCount()
A "select" clause to count all rows of a specific request

Returns:

getFrom

protected java.lang.String getFrom()
Add the "from" clause

Returns:

getFlowRefLeftJoinByType

protected java.lang.String getFlowRefLeftJoinByType(java.lang.String type)
Add the flow ref join clause. It joins on the provided flow type

Parameters:
type - a given flow type
Returns:

getFlowRefLeftJoinGlobal

protected java.lang.String getFlowRefLeftJoinGlobal()
Add the flow ref join clause. It joins on each flow type. Used in global query where there're a lots of different flow types

Returns:

getLastStepLeftJoin

protected java.lang.String getLastStepLeftJoin()
Add the flow step ref and corresponding flow step left join clause. For the flow end step

Returns:

getStartStepLeftJoin

protected java.lang.String getStartStepLeftJoin()
Add the flow step ref and corresponding flow step left join clause. For the flow start step

Returns:

getGlobalOrderBy

protected java.lang.String getGlobalOrderBy()
A generic order by method used to order flow when no sort option selected

Returns:

sort

protected abstract java.lang.String sort(int idxColumn,
                                         java.lang.String sortType)

sortDesc

protected java.lang.String sortDesc(int idxColumn)
Add "order by" clause. Sort descendingly on the given column index

Parameters:
idxColumn - the index of the column to sort
Returns:

sortAsc

protected java.lang.String sortAsc(int idxColumn)
Add "order by" clause. Sort ascendingly on the given column index

Parameters:
idxColumn - the index of the column to sort
Returns:

getLimit

protected java.lang.String getLimit(int indxFirst,
                                    int rowsPerPage)
Add the "limit" clause. Start from the "indxFirst" and ends on the "indxFirst + rowsPerPage"

Parameters:
indxFirst - start index of the returned result
rowsPerPage - number of returned results
Returns:

getMySQLFilterType

protected java.lang.String getMySQLFilterType(Filter.FilterType type,
                                              java.lang.String value)
Return the mysql operator for a given filter type

Parameters:
type - a filter type
Returns:


Copyright © 2009-2010 eBM Websourcing. All Rights Reserved.