Package mondrian.olap

Examples of mondrian.olap.Hierarchy


            processedParamValue = parameterValue;
          }
          else if (parameterType instanceof MemberType)
          {
            final MemberType memberType = (MemberType) parameterType;
            final Hierarchy hierarchy = memberType.getHierarchy();
            if (parameterValue instanceof String)
            {
              final Member member = findMember(query, hierarchy, query.getCube(), String.valueOf(parameterValue));
              if (member != null)
              {
                processedParamValue = new MemberExpr(member);
              }
              else
              {
                processedParamValue = null;
              }
            }
            else
            {
              if (!(parameterValue instanceof OlapElement))
              {
                throw new ReportDataFactoryException(parameterValue + " is incorrect for type " + parameterType);
              }
              else
              {
                processedParamValue = parameterValue;
              }
            }
          }
          else if (parameterType instanceof SetType)
          {
            final SetType setType = (SetType) parameterType;
            final Hierarchy hierarchy = setType.getHierarchy();
            if (parameterValue instanceof String)
            {
              final String rawString = (String) parameterValue;
              final String[] memberStr = rawString.replaceFirst("^ *\\{", "").replaceFirst("} *$", "").split(",");
              final List<Member> list = new ArrayList<Member>(memberStr.length);
View Full Code Here


    {
      resultDirect.close();
    }
    if (memberByUniqueId != null)
    {
      final Hierarchy memberHierarchy = memberByUniqueId.getHierarchy();
      if (hierarchy != memberHierarchy)
      {
        if (ObjectUtilities.equal(hierarchy, memberHierarchy) == false)
        {
          logger.warn("Cannot match hierarchy of member found with the hierarchy specfied in the parameter: " // NON-NLS
              + "Unabe to guarantee that the correct member has been queried, returning null."); // NON-NLS
          return null;
        }
      }
      return memberByUniqueId;
    }
    if (memberById != null)
    {
      final Hierarchy memberHierarchy = memberById.getHierarchy();
      if (hierarchy != memberHierarchy)
      {
        if (ObjectUtilities.equal(hierarchy, memberHierarchy) == false)
        {
          logger.warn("Cannot match hierarchy of member found with the hierarchy specfied in the parameter: " // NON-NLS
View Full Code Here

  protected Member yuckyInternalMondrianLookup(final Query query, final Hierarchy hierarchy, final String parameter)
  {
    final Member memberById = (Member) Util.lookup(query, Util.parseIdentifier(parameter));
    if (memberById != null)
    {
      final Hierarchy memberHierarchy = memberById.getHierarchy();
      if (hierarchy != memberHierarchy)
      {
        if (ObjectUtilities.equal(hierarchy, memberHierarchy) == false)
        {
          logger.warn("Cannot match hierarchy of member found with the hierarchy specfied in the parameter: " // NON-NLS
View Full Code Here

    String memberValue = Util.quoteMdxIdentifier(member.getName());
    while (member.getParentMember() != null) {
      memberValue = Util.quoteMdxIdentifier(member.getParentMember().getName()) + "." + memberValue;
      member = member.getParentMember();
    }
    final Hierarchy hierarchy = member.getHierarchy();
    final Dimension dimension = hierarchy.getDimension();
    if (hierarchy.getName().equals(dimension.getName())) {
      return Util.quoteMdxIdentifier(hierarchy.getName()) + "." + memberValue;
    } else {
      return Util.quoteMdxIdentifier(dimension.getName()) + "." + Util.quoteMdxIdentifier(hierarchy.getName()) + "." +
      memberValue;
    }
  }
View Full Code Here

      if (dimOrder != 0)
      {
        return dimOrder;
      }

      Hierarchy h1 = o1.getHierarchy();
      Hierarchy h2 = o2.getHierarchy();
      int hierarchyOrder = h1.getName().compareTo(h2.getName());
      if (hierarchyOrder != 0)
      {
        return hierarchyOrder;
      }
View Full Code Here

    while (member.getParentMember() != null)
    {
      memberValue = Util.quoteMdxIdentifier(member.getParentMember().getName()) + "." + memberValue;
      member = member.getParentMember();
    }
    final Hierarchy hierarchy = member.getHierarchy();
    final Dimension dimension = hierarchy.getDimension();
    if (hierarchy.getName().equals(dimension.getName()))
    {
      return Util.quoteMdxIdentifier(hierarchy.getName()) + "." + memberValue;
    }
    else
    {
      return Util.quoteMdxIdentifier(dimension.getName()) + "." + Util.quoteMdxIdentifier(hierarchy.getName()) + "." +
          memberValue;
    }
  }
View Full Code Here

        processedParamValue = parameterValue;
      }
      else if (parameterType instanceof MemberType)
      {
        final MemberType memberType = (MemberType) parameterType;
        final Hierarchy hierarchy = memberType.getHierarchy();
        if (parameterValue instanceof String)
        {
          final Member member = findMember(query, hierarchy, query.getCube(), String.valueOf(parameterValue));
          if (member != null)
          {
            processedParamValue = new MemberExpr(member);
          }
          else
          {
            processedParamValue = null;
          }
        }
        else
        {
          if (!(parameterValue instanceof OlapElement))
          {
            throw new ReportDataFactoryException(parameterValue + " is incorrect for type " + parameterType);
          }
          else
          {
            processedParamValue = parameterValue;
          }
        }
      }
      else if (parameterType instanceof SetType)
      {
        final SetType setType = (SetType) parameterType;
        final Hierarchy hierarchy = setType.getHierarchy();
        if (parameterValue instanceof String)
        {
          final String rawString = (String) parameterValue;
          final String[] memberStr = rawString.replaceFirst("^ *\\{", "").replaceFirst("} *$", "").split(",");
          final List<Member> list = new ArrayList<Member>(memberStr.length);
View Full Code Here

    {
      resultDirect.close();
    }
    if (memberByUniqueId != null)
    {
      final Hierarchy memberHierarchy = memberByUniqueId.getHierarchy();
      if (hierarchy != memberHierarchy)
      {
        if (ObjectUtilities.equal(hierarchy, memberHierarchy) == false)
        {
          logger.warn("Cannot match hierarchy of member found with the hierarchy specfied in the parameter: " // NON-NLS
              + "Unabe to guarantee that the correct member has been queried, returning null."); // NON-NLS
          return null;
        }
      }
      return memberByUniqueId;
    }
    if (memberById != null)
    {
      final Hierarchy memberHierarchy = memberById.getHierarchy();
      if (hierarchy != memberHierarchy)
      {
        if (ObjectUtilities.equal(hierarchy, memberHierarchy) == false)
        {
          logger.warn("Cannot match hierarchy of member found with the hierarchy specfied in the parameter: " // NON-NLS
View Full Code Here

  protected Member yuckyInternalMondrianLookup(final Query query, final Hierarchy hierarchy, final String parameter)
  {
    final Member memberById = (Member) Util.lookup(query, Util.parseIdentifier(parameter));
    if (memberById != null)
    {
      final Hierarchy memberHierarchy = memberById.getHierarchy();
      if (hierarchy != memberHierarchy)
      {
        if (ObjectUtilities.equal(hierarchy, memberHierarchy) == false)
        {
          logger.warn("Cannot match hierarchy of member found with the hierarchy specfied in the parameter: " // NON-NLS
View Full Code Here

            super(exp, new Calc[] {hierarchyCalc});
            this.hierarchyCalc = hierarchyCalc;
        }

        public Dimension evaluateDimension(Evaluator evaluator) {
            Hierarchy hierarchy =
                    hierarchyCalc.evaluateHierarchy(evaluator);
            return hierarchy.getDimension();
        }
View Full Code Here

TOP

Related Classes of mondrian.olap.Hierarchy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.