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-1062
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

Simplify process of defining static methods for JDOQL; currently resolves the class name to a ClassLiteral during compilation, incorrectly

Created: 30/Jul/13 06:07 PM   Updated: 31/Jul/13 04:53 PM   Resolved: 30/Jul/13 06:26 PM
Component/s: Queries
Affects Version/s: 2.2.4, 3.0.11, 3.1.5, 3.2.5
Fix Version/s: 3.2.6


 Description  « Hide
Where we define a static method for JDOQL like
String.valueOf(...)

this is being compiled as
InvokeExpression{[Literal{class java.lang.String}].valueOf(PrimaryExpression{myField})}

but should be compiled as
InvokeExpression{STATIC.String.valueOf(PrimaryExpression{myField})}

The workaround is to define a query "prefix" as

<extension point="org.datanucleus.query_method_prefix">
    <query-method-prefix prefix="String" alias="String"/>
</extension>

but that is a bit hacky IMHO.

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 30/Jul/13 06:26 PM
SVN trunk now detects an invoke on a class literal and converts the compilation into a static invoke