users@jpa-spec.java.net

[jpa-spec users] [jsr338-experts] Re: CriteriaUpdate/CriteriaDelete questions

From: Rainer Kwesi Schweigkoffer <kwesi_at_sap.com>
Date: Tue, 03 Jul 2012 17:07:19 +0200

Hi Linda, all,

Linda DeMichiel, am 29 Jun 2012 hast Du um 12:31 zum Thema "[jsr338-
experts] Re: CriteriaUpdate/CriteriaDelet" geschrieben :

> Hi Steve, all,
>
> My concern here is that this is a backwards incompatible change with
> regard to Subquery#getParent().
>
> I'm not sure what the best thing to do here is. I've attached revisions
> of CriteriaUpdate and CriteriaDelete that try to work around the problem,
> but I'm really not happy about how these abuse the typing.
>
> Suggestions appreciated.


another - also not very nice - possibility is to

o factor out all methods from Subquery into AbstractSubquery apart from
the getParent method

o have Subquery extend AbstractSubquery, additionally providing its
getParent method

o create a ModificationSubquery interface extending AbstractSubquery
and providing AbstractModification<?> getParent()

where AbstractModification is an interface extended by both
CriteriaUpdate and CriteriaDelete (as proposed in my mail message of
April 1st, 2011)

o have CriteriaUpdate/CriteriaDelete's subquery() method return
ModificationSubquery.

It's a patch, of course.

Best regards
Rainer



---
Rainer Schweigkoffer               SAP AG Walldorf
Java Persistence                   TIP Core JI
Core Java Infrastructure           Dietmar-Hopp-Allee 16
Technology & Innovation Platform   D-69190 Walldorf
Building 3, I.3.14                 phone: +49 6227 7 45305
rainer.schweigkoffer_at_sap.com       fax:   +49 6227 7 821177
Sitz der Gesellschaft/Registered Office: Walldorf, Germany
Vorstand/SAP Executive Board: Werner Brandt, 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.