mondrian.rolap
Class HighCardSqlTupleReader

java.lang.Object
  extended by mondrian.rolap.SqlTupleReader
      extended by mondrian.rolap.HighCardSqlTupleReader
All Implemented Interfaces:
TupleReader

public class HighCardSqlTupleReader
extends SqlTupleReader

Reads the members of a single level (level.members) or of multiple levels (crossjoin).

Since:
Dec, 2007
Author:
luis f. canals
 

Nested Class Summary
(package private) static class HighCardSqlTupleReader.WhichSelect
          Description of the position of a SELECT statement in a UNION.
 
Nested classes/interfaces inherited from interface mondrian.rolap.TupleReader
TupleReader.MemberBuilder
 
Field Summary
(package private)  int maxRows
           
 
Fields inherited from class mondrian.rolap.SqlTupleReader
constraint
 
Constructor Summary
HighCardSqlTupleReader(TupleConstraint constraint)
           
 
Method Summary
 void addLevelMembers(RolapLevel level, TupleReader.MemberBuilder memberBuilder, List<RolapMember> srcMembers)
          Adds a hierarchy to retrieve members from.
 Object getCacheKey()
          Returns an object that uniquely identifies the Result that this TupleReader would return.
 int getEnumTargetCount()
           
 int getMaxRows()
           
 void noMoreRows()
          Avoids loading of more results.
protected  void prepareTuples(DataSource dataSource, List<List<RolapMember>> partialResult, List<List<RolapMember>> newPartialResult)
           
 List<RolapMember> readMembers(DataSource dataSource, List<List<RolapMember>> partialResult, List<List<RolapMember>> newPartialResult)
          Performs the read.
 boolean readNextTuple()
          Reads next tuple notifing all internal targets.
 List<RolapMember[]> readTuples(DataSource jdbcConnection, List<List<RolapMember>> partialResult, List<List<RolapMember>> newPartialResult)
          Performs the read.
 void setMaxRows(int maxRows)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxRows

int maxRows
Constructor Detail

HighCardSqlTupleReader

public HighCardSqlTupleReader(TupleConstraint constraint)
Method Detail

addLevelMembers

public void addLevelMembers(RolapLevel level,
                            TupleReader.MemberBuilder memberBuilder,
                            List<RolapMember> srcMembers)
Description copied from interface: TupleReader
Adds a hierarchy to retrieve members from.

Specified by:
addLevelMembers in interface TupleReader
Overrides:
addLevelMembers in class SqlTupleReader
Parameters:
level - level that the members correspond to
memberBuilder - used to build new members for this level
srcMembers - if set, array of enumerated members that make up this level

getCacheKey

public Object getCacheKey()
Description copied from interface: TupleReader
Returns an object that uniquely identifies the Result that this TupleReader would return. Clients may use this as a key for caching the result.

Specified by:
getCacheKey in interface TupleReader
Overrides:
getCacheKey in class SqlTupleReader

getEnumTargetCount

public int getEnumTargetCount()
Overrides:
getEnumTargetCount in class SqlTupleReader
Returns:
number of targets that contain enumerated sets with calculated members

prepareTuples

protected void prepareTuples(DataSource dataSource,
                             List<List<RolapMember>> partialResult,
                             List<List<RolapMember>> newPartialResult)
Overrides:
prepareTuples in class SqlTupleReader

readMembers

public List<RolapMember> readMembers(DataSource dataSource,
                                     List<List<RolapMember>> partialResult,
                                     List<List<RolapMember>> newPartialResult)
Description copied from interface: TupleReader
Performs the read.

Specified by:
readMembers in interface TupleReader
Overrides:
readMembers in class SqlTupleReader
Parameters:
dataSource - source for reading tuples
partialResult - partially cached result that should be used instead of executing sql query
newPartialResult - if non-null, return the result of the read; note that this is a subset of the full return list
Returns:
a list of RolapMember

readTuples

public List<RolapMember[]> readTuples(DataSource jdbcConnection,
                                      List<List<RolapMember>> partialResult,
                                      List<List<RolapMember>> newPartialResult)
Description copied from interface: TupleReader
Performs the read.

Specified by:
readTuples in interface TupleReader
Overrides:
readTuples in class SqlTupleReader
Returns:
a list of RolapMember[]

noMoreRows

public void noMoreRows()
Avoids loading of more results.


readNextTuple

public boolean readNextTuple()
Reads next tuple notifing all internal targets.

Returns:
whether there are any more rows

setMaxRows

public void setMaxRows(int maxRows)
Overrides:
setMaxRows in class SqlTupleReader

getMaxRows

public int getMaxRows()
Overrides:
getMaxRows in class SqlTupleReader

SourceForge.net_Logo