3 Replies Latest reply on Jun 16, 2009 10:20 PM by nickarls

    ejbql parameter resolving

    nickarls

      I have a components.xml defined ejbql with an EL-parameter. I noticed from the code in EntityQuery/Query that it might be able to refresh the resultList based on dirty parameters but I didn't see that behaviour so I stepped through the code in the debugger and it appears as if the EL parameter has already been merged into the ejbql in parseEjbql and the parameters list is alwats considered empty (and therfore isAnyParameterDirty has nothing to work on).


      How is this supposed to work?

        • 1. Re: ejbql parameter resolving

          Yes, this is an existing problem that I have been meaning to create a JIRA for.


          Basically the ejbql attribute is defined as a String which means the EL is evaluated when the EntityQuery/Query component is created from components.xml.  Any ValueExpression result is then set directly into the ejbql String (which is why you are seeing this behavior).


          The fix is changing the ejbql attribute to a ValueExpression type and using the getExpressionString() to retrieve the original ejbql String when parsing the ejbql.


          I will post up a JIRA and get the fix in as soon as I can :-)


          Hope that helps.

          • 2. Re: ejbql parameter resolving

            JIRA Issue: JBSEAM-4251

            • 3. Re: ejbql parameter resolving
              nickarls

              Ah, yes, I thought it was something like that. Haven't used entity-queries with parameters before and didn't quite get the source code to match what I thought it would be doing. Thanks for the info.