Class RolapCubeHierarchy.RolapCubeSqlMemberSource
- java.lang.Object
-
- mondrian.rolap.RolapCubeHierarchy.RolapCubeSqlMemberSource
-
- All Implemented Interfaces:
MemberSource
,TupleReader.MemberBuilder
- Enclosing class:
- RolapCubeHierarchy
public static class RolapCubeHierarchy.RolapCubeSqlMemberSource extends Object
-
-
Constructor Summary
Constructors Constructor Description RolapCubeSqlMemberSource(RolapCubeHierarchy.RolapCubeHierarchyMemberReader memberReader, RolapCubeHierarchy hierarchy, MemberCacheHelper memberSourceCacheHelper, Object memberCacheLock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RolapMember
allMember()
Returns the 'all' member of the hierarchy.int
compare(RolapMember m1, RolapMember m2, boolean siblingsAreEqual)
RolapMember
desubstitute(RolapMember member)
RolapMember
getDefaultMember()
RolapHierarchy
getHierarchy()
Returns the hierarchy that this source is reading for.RolapMember
getLeadMember(RolapMember member, int n)
int
getLevelMemberCount(RolapLevel level)
TupleReader.MemberBuilder
getMemberBuilder()
RolapMember
getMemberByKey(RolapLevel level, List<Comparable> keyValues)
mondrian.rolap.MemberCache
getMemberCache()
Returns theMemberCache
to look up members before creating them.Object
getMemberCacheLock()
use the same lock in the RolapCubeMemberSource as the RolapCubeHiearchyMemberReader to avoid deadlocksvoid
getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children)
Returns all members which are a child of one of the members inparentMembers
, sorted by ordinal.Map<? extends Member,Access>
getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children, MemberChildrenConstraint mcc)
void
getMemberChildren(RolapMember parentMember, List<RolapMember> children)
Writes all childrenparentMember
tochildren
.Map<? extends Member,Access>
getMemberChildren(RolapMember parentMember, List<RolapMember> children, MemberChildrenConstraint constraint)
int
getMemberCount()
Returns an estimate of number of members in this hierarchy.RolapMember
getMemberParent(RolapMember member)
void
getMemberRange(RolapLevel level, RolapMember startMember, RolapMember endMember, List<RolapMember> memberList)
List<RolapMember>
getMembers()
Returns all members of this hierarchy, sorted by ordinal.List<RolapMember>
getMembersInLevel(RolapLevel level)
List<RolapMember>
getMembersInLevel(RolapLevel level, TupleConstraint constraint)
List<RolapMember>
getRootMembers()
Returns all members of this hierarchy which do not have a parent, sorted by ordinal.static boolean
isLevelCollapsed(AggStar aggStar, RolapCubeLevel level)
Determine if the given aggregate table has the dimension level specified within in (AggStar.FactTable) it, aka collapsed, or associated with foreign keys (AggStar.DimTable)static boolean
levelContainsMultipleColumns(RolapLevel level)
Determine if a level contains more than a single column for its data, such as an ordinal column or property columnRolapMember
lookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
Finds a member based upon its unique name.RolapMember
makeMember(RolapMember parentMember, RolapLevel childLevel, Object value, Object captionValue, boolean parentChild, SqlStatement stmt, Object key, int columnOffset)
Creates a new member (together with its properties).boolean
setCache(mondrian.rolap.MemberCache cache)
Sets the cache which thisMemberSource
will write to.RolapMember
substitute(RolapMember member)
-
-
-
Constructor Detail
-
RolapCubeSqlMemberSource
public RolapCubeSqlMemberSource(RolapCubeHierarchy.RolapCubeHierarchyMemberReader memberReader, RolapCubeHierarchy hierarchy, MemberCacheHelper memberSourceCacheHelper, Object memberCacheLock)
-
-
Method Detail
-
makeMember
public RolapMember makeMember(RolapMember parentMember, RolapLevel childLevel, Object value, Object captionValue, boolean parentChild, SqlStatement stmt, Object key, int columnOffset) throws SQLException
Description copied from interface:TupleReader.MemberBuilder
Creates a new member (together with its properties).- Specified by:
makeMember
in interfaceTupleReader.MemberBuilder
- Parameters:
parentMember
- Parent memberchildLevel
- Child levelvalue
- Member valuecaptionValue
- CaptionparentChild
- Whether a parent-child hierarchystmt
- SQL statementkey
- Member keycolumnOffset
- Column ordinal (0-based)- Returns:
- new member
- Throws:
SQLException
- on error
-
getMemberCache
public mondrian.rolap.MemberCache getMemberCache()
Description copied from interface:TupleReader.MemberBuilder
Returns theMemberCache
to look up members before creating them.- Specified by:
getMemberCache
in interfaceTupleReader.MemberBuilder
- Returns:
- member cache
-
getMemberCacheLock
public Object getMemberCacheLock()
use the same lock in the RolapCubeMemberSource as the RolapCubeHiearchyMemberReader to avoid deadlocks- Specified by:
getMemberCacheLock
in interfaceTupleReader.MemberBuilder
- Returns:
- Object to lock
-
allMember
public RolapMember allMember()
Description copied from interface:TupleReader.MemberBuilder
Returns the 'all' member of the hierarchy.- Specified by:
allMember
in interfaceTupleReader.MemberBuilder
- Returns:
- The 'all' member
-
getHierarchy
public RolapHierarchy getHierarchy()
Description copied from interface:MemberSource
Returns the hierarchy that this source is reading for.- Specified by:
getHierarchy
in interfaceMemberSource
-
setCache
public boolean setCache(mondrian.rolap.MemberCache cache)
Description copied from interface:MemberSource
Sets the cache which thisMemberSource
will write to.Cache-writeback is optional (for example,
SqlMemberSource
supports it, andArrayMemberSource
does not), and the return value from this method indicates whether this object supports it.If this method returns
true
, theMemberSource.getMembers()
,MemberSource.getRootMembers()
andMemberSource.getMemberChildren(mondrian.rolap.RolapMember, java.util.List<mondrian.rolap.RolapMember>)
methods must write to the cache, in addition to returning members as a return value.- Specified by:
setCache
in interfaceMemberSource
- Parameters:
cache
- TheMemberCache
which the caller would like thisMemberSource
to write to.- Returns:
- Whether this
MemberSource
supports cache-writeback.
-
getMemberCount
public int getMemberCount()
Description copied from interface:MemberSource
Returns an estimate of number of members in this hierarchy.- Specified by:
getMemberCount
in interfaceMemberSource
-
substitute
public RolapMember substitute(RolapMember member)
-
desubstitute
public RolapMember desubstitute(RolapMember member)
-
getMemberByKey
public RolapMember getMemberByKey(RolapLevel level, List<Comparable> keyValues)
-
lookupMember
public RolapMember lookupMember(List<Id.Segment> uniqueNameParts, boolean failIfNotFound)
Description copied from interface:MemberSource
Finds a member based upon its unique name.- Specified by:
lookupMember
in interfaceMemberSource
-
getLevelMemberCount
public int getLevelMemberCount(RolapLevel level)
-
getMembers
public List<RolapMember> getMembers()
Description copied from interface:MemberSource
Returns all members of this hierarchy, sorted by ordinal.If this object
supports cache-writeaback
, also writes these members to the cache.- Specified by:
getMembers
in interfaceMemberSource
-
getMembersInLevel
public List<RolapMember> getMembersInLevel(RolapLevel level)
-
getMembersInLevel
public List<RolapMember> getMembersInLevel(RolapLevel level, TupleConstraint constraint)
-
getRootMembers
public List<RolapMember> getRootMembers()
Description copied from interface:MemberSource
Returns all members of this hierarchy which do not have a parent, sorted by ordinal.If this object
supports cache-writeback
, also writes these members to the cache.- Specified by:
getRootMembers
in interfaceMemberSource
- Returns:
List
ofRolapMember
s
-
levelContainsMultipleColumns
public static boolean levelContainsMultipleColumns(RolapLevel level)
Determine if a level contains more than a single column for its data, such as an ordinal column or property column- Parameters:
level
- the level to check- Returns:
- true if multiple relational columns are involved in this level
-
isLevelCollapsed
public static boolean isLevelCollapsed(AggStar aggStar, RolapCubeLevel level)
Determine if the given aggregate table has the dimension level specified within in (AggStar.FactTable) it, aka collapsed, or associated with foreign keys (AggStar.DimTable)- Parameters:
aggStar
- aggregate star if existslevel
- level- Returns:
- true if agg table has level or not
-
getMemberChildren
public void getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children)
Description copied from interface:MemberSource
Returns all members which are a child of one of the members inparentMembers
, sorted by ordinal.If this object
supports cache-writeaback
, also writes these members to the cache.- Specified by:
getMemberChildren
in interfaceMemberSource
-
getMemberChildren
public Map<? extends Member,Access> getMemberChildren(List<RolapMember> parentMembers, List<RolapMember> children, MemberChildrenConstraint mcc)
-
getMemberChildren
public void getMemberChildren(RolapMember parentMember, List<RolapMember> children)
Description copied from interface:MemberSource
Writes all childrenparentMember
tochildren
.If this object
supports cache-writeback
, also writes these members to the cache.- Specified by:
getMemberChildren
in interfaceMemberSource
-
getMemberChildren
public Map<? extends Member,Access> getMemberChildren(RolapMember parentMember, List<RolapMember> children, MemberChildrenConstraint constraint)
-
getLeadMember
public RolapMember getLeadMember(RolapMember member, int n)
-
getMemberRange
public void getMemberRange(RolapLevel level, RolapMember startMember, RolapMember endMember, List<RolapMember> memberList)
-
compare
public int compare(RolapMember m1, RolapMember m2, boolean siblingsAreEqual)
-
getMemberBuilder
public TupleReader.MemberBuilder getMemberBuilder()
-
getDefaultMember
public RolapMember getDefaultMember()
-
getMemberParent
public RolapMember getMemberParent(RolapMember member)
-
-