DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-474
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

Generic compile of JDOQL "collField.contains(var) && var.startsWith('Value')" compiled incorrectly

Created: 27/Feb/10 02:56 PM   Updated: 17/Mar/10 08:54 PM   Resolved: 27/Feb/10 03:02 PM
Component/s: Queries
Affects Version/s: 2.0.0.release, 2.0.1
Fix Version/s: 2.0.2


 Description  « Hide
If we have a filter of
collField.contains(var) && var.startsWith('Value')
where collField is declared as Collection<String> then this is currently compiled as
DyadicExpression
{
    InvokeExpression{[PrimaryExpression{this.names}].contains(VariableExpression{theName})}
    AND
    VariableExpression{theName}
}

i.e the invocation on the variable in the second clause is missed!

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 27/Feb/10 03:02 PM
SVN trunk now compiles this correctly. The provided example is compiled as
DyadicExpression
{
    InvokeExpression
    {
        [PrimaryExpression{this.names}.contains(VariableExpression{theName})
    }
    AND InvokeExpression
    {
        [VariableExpression{theName}].startsWith(Literal{Fir})
    }
}