jsr338-experts@jpa-spec.java.net

[jsr338-experts] Re: JPQL function invocation

From: Werner Keil <werner.keil_at_gmail.com>
Date: Thu, 10 Mar 2011 02:09:36 +0530

About the syntax, I'd say yes, I was wondering about other things, after
having joined JPA Diagram Editor as Interested Party.
It just graduated to Dali, where beside the obvious EclipseLink the new spec
will have its effect. Not for Indigo any more, probably next year?

Werner

On Thu, Mar 10, 2011 at 12:24 AM, Linda DeMichiel <
linda.demichiel_at_oracle.com> wrote:

> I haven't gotten any responses to this.
>
> Should I interpret silence as consent and add this to the
> spec? Please let me know one way or the other.
>
> thanks,
>
> -Linda
>
>
>
> On 3/7/2011 1:20 PM, Linda DeMichiel wrote:
>
>> In JPA 2.0 we extended the criteria API with the CriteriaBuilder
>> function method
>>
>> <T> Expression<T> function (String name, Class<T> type, Expression<?>...
>> args);
>>
>> with the expectation that we would add similar support to JPQL in this
>> release.
>>
>> The Criteria API currently doesn't specify whether we meant to support
>> aggregate/table functions via this mechanism as well as scalar
>> functions, although the syntax supports it. We need to discuss this,
>> and, assuming that we do support it, we need to clarify this point in
>> the spec.
>>
>> I would propose that we support both scalar and aggregate functions in
>> JPQL as well as in the criteria API.
>>
>> Here's a strawman syntax for JPQL to kick off the discussion
>>
>> FUNC(function_name, arg1, ..., argn)
>>
>> Function_name is a string that denotes the database function that is
>> to be invoked.
>>
>> Example:
>>
>> SELECT c
>> FROM Customer c
>> WHERE FUNC("hasGoodCredit", c.balance, c.creditLimit)
>>
>> 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.
>>
>> Opinions?
>>
>> thanks,
>>
>> -Linda
>>
>


-- 
 Werner Keil | UOMo Lead | Eclipse Foundation | Agile Coach, Principal
Consultant | *emergn* limited
590 Madison Avenue. New York. NY 10022 | 68 Lombard Street. London EC3V 9LJ
UK
US Toll Free:  +1-877.964.1981 | Worldwide Toll Free:  +800.225.53482
Skype: werner.keil|www.emergn.com | Reshaping IT
* STP Conference & Expo: March 24, 2011, Nashville, TN. Werner Keil, Agile
Coach and Principal Consultant, will be presenting "Agile Test Automation"
* Great Indian Developer Summit: April 21, 2011, Bangalore, India. Werner
Keil, Agile Coach and Principal Consultant, will be presenting "Java EE 7,
CDI and Trusted Java"