Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-2175

AliasName used in EJBQLQuery is not working if it contains mixed case.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.M4
    • 4.0.M4
    • Core Library

    Description

      While using EJBQLQuery, the alias name is not working if it is in mixed case and throws some exception saying: "unmapped id variable:"

      Eg:
      Working:
      EJBQLQuery query = new EJBQLQuery("SELECT artistAlias from Artist artistAlias JOIN artistalias.paintings paintingsAlias where artistalias.artistName = 'Abcd');

      Not Working:
      EJBQLQuery query = new EJBQLQuery("SELECT artistAlias from Artist artistAlias JOIN artistAlias.paintings paintingsAlias where artistAlias.artistName = 'Abcd');

      We declared the alias variable as "artistAlias" but it is not working if you say artistAlias.artistName and working if you say artistalias.artistName

      In Compiler.java class, visitFromItem... method
      while adding the alias variable name in the dictionary we convert it into lower case
      // per JPA spec, 4.4.2, "Identification variables are case insensitive."
      String id = normalizeIdPath(expression.getId());
      ClassDescriptor old = descriptorsById.put(id, descriptor);

      but in visitPath... method while retrieving the alias variable name from the dictionary we are not converting to lower case.

      this.id = ((EJBQLPath) expression).getId();
      this.descriptor = descriptorsById.get(id);
      if (descriptor == null)

      { throw new EJBQLException("Unmapped id variable: " + id); }

      Attachments

        Issue Links

          Activity

            People

              ntimofeev Nikita Timofeev
              kumar9885035454 Saravana Kumar M
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified