jsr338-experts@jpa-spec.java.net

[jsr338-experts] JPQL <-> Criteria

From: Rainer Kwesi Schweigkoffer <kwesi_at_sap.com>
Date: Fri, 15 Apr 2011 15:37:00 +0200

Hi everybody,

since we are having a CriteriaBase now, I think this is a good place to
add a

String toJPQL()

method there, which was to provide means to easily trace and/or display
a criteria query. We would have to resolve the issue of unnamed
parameters though. For the purposes mentioned one could perfectly live
with an implementation-defined naming scheme, I'd say. If someone, for
whatsoever reasons, wanted to execute such a query, they should stick
to named parameters then.

For dynamically amending a given named query one would wish an opposite
method on TypedQuery as well. For appropriate typing we would probably
need three of them

CriteriaQuery<T> createCriteriaQuery();
CriteriaDelete<T> createCriteriaDelete();
CriteriaUpdate<T> createCriteriaUpdate();

Here we would have to deal with positional parameters. We may create
parameter objects for them, but we don't support their usage within
criteria queries. We could therfore either consider them an error when
invoking one of those methods, leave the behaviour undefined or provide
a simple naming scheme, since mixed use of named and positional
parameters is not supported. (It might, by the way, be helpful to
readers if that statement from section 4.6.4 was also mentioned
somewhere between 3.8.10 and 3.8.12).

What do you think about this ?

Best regards
Rainer










---
Rainer Schweigkoffer                      SAP AG Walldorf
Business Solution & Technology            TD Core JS&I
Technology Development                    Dietmar-Hopp-Allee 16
Java Server Core                          D-69190 Walldorf
JEE Implementation Group           phone: +49 6227 7 45305
Building 3, I.3.14                 fax:   +49 6227 7 821177
rainer.schweigkoffer_at_sap.com
Sitz der Gesellschaft/Registered Office: Walldorf, Germany
Vorstand/SAP Executive Board: Werner Brandt, Angelika Dammann,
Bill McDermott (Co-CEO), Gerhard Oswald, Vishal Sikka,
Jim Hagemann Snabe (Co-CEO)
Vorsitzender des Aufsichtsrats/Chairperson of the SAP Supervisory 
Board: Hasso Plattner
Registergericht/Commercial Register Mannheim No HRB 350269
Diese E-Mail kann Betriebs- oder Geschaeftsgeheimnisse oder sonstige
vertrauliche Informationen enthalten. Sollten Sie diese E-Mail 
irrtuemlich erhalten haben, ist Ihnen eine Verwertung des Inhalts, 
eine Vervielfaeltigung oder Weitergabe der E-Mail ausdruecklich 
untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die 
empfangene E-Mail. Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or
otherwise confidential information. If you have received this e-mail 
in error, you are hereby notified that any review, copying, or 
distribution of it is strictly prohibited. Please inform us 
immediately and destroy the original transmittal. Thank you for your 
cooperation.