org.makumba.list.engine
Class ComposedSubquery

java.lang.Object
  extended by org.makumba.list.engine.ComposedQuery
      extended by org.makumba.list.engine.ComposedSubquery

public class ComposedSubquery
extends ComposedQuery

A subquery of a composed query

Version:
$Id: ComposedSubquery.java 5154 2010-05-18 22:01:40Z rosso_nero $
Author:
Cristian Bogdan

Nested Class Summary
 
Nested classes/interfaces inherited from class org.makumba.list.engine.ComposedQuery
ComposedQuery.Evaluator
 
Field Summary
(package private)  ComposedQuery superQuery
          The enclosing query
 
Fields inherited from class org.makumba.list.engine.ComposedQuery
derivedSections, empty, FROM, fromAnalyzerOQL, GROUPBY, keyset, keysetLabels, ORDERBY, previousKeyset, projectionExpr, projections, qep, sections, STATIC_WHERE, subqueries, typeAnalyzerOQL, VARFROM, WHERE
 
Constructor Summary
ComposedSubquery(String[] subsections, ComposedQuery cq, String queryLanguage)
          Make a subquery of the indicated query, from the given sections.
 
Method Summary
(package private) static void concat(String[] result, String[] h1, String[] h2, int what, String sep, boolean paran)
          Concatenates sections on the given index, with the given separator
(package private)  void deriveFrom(int n)
          Derives the FROM section using the sections of the superQuery
protected  void initKeysets()
          Initializes the keysets by adding the superquery's previousKeyset to its keyset.
 String toString()
           
 
Methods inherited from class org.makumba.list.engine.ComposedQuery
addProjection, addProjectionDirectly, addSubquery, analyze, checkExpr, checkExprSetOrNullable, checkProjection, checkProjectionInteger, columnName, computeQuery, execute, getComputedQuery, getFromLabelTypes, getFromSection, getGroupBySection, getLabelType, getProjectionAt, getProjections, getProjectionTypes, getResultType, getTypeAnalyzerQuery, init, prependFromToKeyset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

superQuery

ComposedQuery superQuery
The enclosing query

Constructor Detail

ComposedSubquery

public ComposedSubquery(String[] subsections,
                        ComposedQuery cq,
                        String queryLanguage)
Make a subquery of the indicated query, from the given sections.

Parameters:
usesHQL - true if we use Hibernate to execute the query
Method Detail

deriveFrom

void deriveFrom(int n)
Derives the FROM section using the sections of the superQuery

Parameters:
n - the index of the section

concat

static void concat(String[] result,
                   String[] h1,
                   String[] h2,
                   int what,
                   String sep,
                   boolean paran)
Concatenates sections on the given index, with the given separator

Parameters:
result - the String array containing the result
h1 - first array of sections
h2 - second array of sections
what - the index at which we should concatenate
paran - do we want parenthesis

initKeysets

protected void initKeysets()
Initializes the keysets by adding the superquery's previousKeyset to its keyset.

Overrides:
initKeysets in class ComposedQuery

toString

public String toString()
Overrides:
toString in class ComposedQuery