Skip to content

Commit

Permalink
Code Refactor: Enhance RTP related feature.
Browse files Browse the repository at this point in the history
Signed-off-by: Pengcheng Bian <[email protected]>
  • Loading branch information
TerryPCBian committed Jan 7, 2015
1 parent 76baabe commit 9dabd8b
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1222,11 +1222,16 @@ public static ComputedColumnHandle getMeasureBindingColumnHandle( MeasureViewHan

public static boolean isLinkedDataModelMeasureView( MeasureViewHandle mv )
{
String refColumn = getRefLinkedDataModelColumnName( mv );
String refColumn = getRefLinkedDataModelColumnName( mv, true );
return refColumn != null && !refColumn.isEmpty();
}

public static String getRefLinkedDataModelColumnName( MeasureViewHandle mv )
{
return getRefLinkedDataModelColumnName( mv, false );
}

public static String getRefLinkedDataModelColumnName( MeasureViewHandle mv, boolean ignoreRTP )
{
if( mv == null )
{
Expand All @@ -1246,6 +1251,12 @@ public static String getRefLinkedDataModelColumnName( MeasureViewHandle mv )
&& ch.getAggregateFunction() != null
&& !ch.getAggregateFunction().isEmpty() )
{
if( ignoreRTP && ch.getCalculationType( ) != null )
{
// ignore RTP computed measure view
return null;
}

ExpressionHandle expr = ch
.getExpressionProperty( ComputedColumn.EXPRESSION_MEMBER );
String expression = (expr != null) ? expr.getStringExpression( ) : null;
Expand Down

0 comments on commit 9dabd8b

Please sign in to comment.