glassfish
  1. glassfish
  2. GLASSFISH-2771

MOD does not allow field expressions on both sides

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.1pe
    • Fix Version/s: 9.1pe_dev
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: All

    • Issuezilla Id:
      2,771

      Description

      The specification requires that the MOD function accept
      simple_arithmetic_expression on both sides of MOD(ex1, ex2), but TLE throws an
      exception in the following query:

      Query q = em.createQuery("SELECT p FROM Passenger p WHERE MOD(p.id, p.modField)
      = 0");

      The exception that is thrown is:

      Exception: java.lang.ClassCastException:
      oracle.toplink.essentials.internal.parsing.DotNode
      java.lang.ClassCastException: oracle.toplink.essentials.internal.parsing.DotNode
      at oracle.toplink.essentials.internal.parsing.ModNode.generateExpression
      (ModNode.java:93)
      at
      oracle.toplink.essentials.internal.parsing.EqualsNode.generateExpression
      (EqualsNode.java:76)
      at
      oracle.toplink.essentials.internal.parsing.WhereNode.generateExpression
      (WhereNode.java:57)
      at
      oracle.toplink.essentials.internal.parsing.ParseTree.generateExpression
      (ParseTree.java:383)
      at
      oracle.toplink.essentials.internal.parsing.ParseTree.setSelectionCriteriaForQuer
      y(ParseTree.java:561)
      at
      oracle.toplink.essentials.internal.parsing.EJBQLParseTree.populateReadQueryInter
      nal(EJBQLParseTree.java:128)
      at
      oracle.toplink.essentials.internal.parsing.EJBQLParseTree.populateQuery
      (EJBQLParseTree.java:93)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabase
      Query(EJBQueryImpl.java:204)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabase
      Query(EJBQueryImpl.java:174)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.buildEJBQLDatabase
      Query(EJBQueryImpl.java:138)
      at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.<init>
      (EJBQueryImpl.java:99)
      at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.<init>
      (EJBQueryImpl.java:84)
      at oracle.toplink.essentials.internal.ejb.cmp3.EJBQueryImpl.<init>
      (EJBQueryImpl.java:71)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.createQuery
      (EntityManagerImpl.java:189)

        Activity

        Hide
        mb124283 added a comment -

        Reassign the issue to myself

        Show
        mb124283 added a comment - Reassign the issue to myself
        Hide
        mb124283 added a comment -

        Started looking into this.

        Show
        mb124283 added a comment - Started looking into this.
        Hide
        gfbugbridge added a comment -

        <BT6543393>

        Show
        gfbugbridge added a comment - <BT6543393>
        Hide
        mb124283 added a comment -

        I changed the ModNode implementation to be similar to binary operators such as
        PlusNode, MinusNode, etc.

        Here is the changelog:
        http://fisheye5.cenqua.com/changelog/glassfish/entity-persistence?cs=MAIN:mb124283:20070412155659

        Show
        mb124283 added a comment - I changed the ModNode implementation to be similar to binary operators such as PlusNode, MinusNode, etc. Here is the changelog: http://fisheye5.cenqua.com/changelog/glassfish/entity-persistence?cs=MAIN:mb124283:20070412155659
        Hide
        mb124283 added a comment -

        Fixed target milestone.

        Show
        mb124283 added a comment - Fixed target milestone.
        Hide
        marina vatkina added a comment -
            • Issue 2950 has been marked as a duplicate of this issue. ***
        Show
        marina vatkina added a comment - Issue 2950 has been marked as a duplicate of this issue. ***

          People

          • Assignee:
            mb124283
            Reporter:
            mkeith
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: