openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey (JIRA)" <>
Subject [jira] Commented: (OPENJPA-273) Native functions in JPQL; functions available in more clauses
Date Wed, 04 Jul 2007 14:23:05 GMT


Patrick Linskey commented on OPENJPA-273:

Another potential approach: create some syntax for escaping a part of a query to SQL, and
then permit nested escapes back to JPQL (or at least JPQL parameters and path expressions)
 from within the SQL bits. The query that I mentioned above might look like so:

    select :sql{stdev(:jpql{emp.salary})} from Employee emp

This has the advantage of permitting arbitrary SQL (excepting the escape sequence, which is
':jpql{' here) to be used. So, we can do an EXTRACT function like so:

    select distinct :sql{EXTRACT(year FROM :jpql{emp.hireDate})} from Employee emp

> Native functions in JPQL; functions available in more clauses
> -------------------------------------------------------------
>                 Key: OPENJPA-273
>                 URL:
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: jdbc, kernel, query
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>            Reporter: Patrick Linskey
>         Attachments: OPENJPA-273.patch
> JPQL has rather limited support for functions, in two ways. First, only a limited number
of commonly-available functions are available in the language, and second, functions can only
be used in a limited number of places in the grammar. This can be, well, limiting.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message