Issue Details (XML | Word | Printable)

Key: NUCJPA-234
Type: New Feature New Feature
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 API JPA

Support JPA 2.1 JPQL "FUNCTION"

Created: 28/May/13 08:18 AM   Updated: 10/Jun/13 08:46 AM   Resolved: 29/May/13 05:35 PM
Component/s: API
Affects Version/s: None
Fix Version/s: 3.3.0.m1


 Description  « Hide
4.6.17.3 Invocation of Predefined and User-defined Database Functions

The invocation of functions other than the built-in functions of the Java Persistence query language is supported by means of the function_invocation syntax. This includes the invocation of predefined database functions and user-defined database functions.

function_invocation::= FUNCTION(function_name {, function_arg}*)
function_arg ::=
literal | state_valued_path_expression | input_parameter | scalar_expression

The function_name argument is a string that denotes the database function that is to be invoked. The arguments must be suitable for the database function that is to be invoked. The result of the function must be suitable for the invocation context. The function may be a database-defined function or a user-defined function. The function may be a scalar function or an aggregate function.

Applications that use the function_invocation syntax will not be portable across databases.
Example:
SELECT c
FROM Customer c
WHERE FUNCTION('hasGoodCredit', c.balance, c.creditLimit)

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 29/May/13 05:35 PM
SVN trunk adds support for this