[jsr338-experts] CriteriaUpdate/CriteriaDelete questions
- From: Steve Ebersole <steve.ebersole@...>
- To: jsr338-experts@...
- Subject: [jsr338-experts] CriteriaUpdate/CriteriaDelete questions
- Date: Sun, 24 Jun 2012 10:31:48 -0500
In implementing theses, I ran into 2 questions:
1) In terms of a Subquery associated with a
CriteriaUpdate/CriteriaDelete, what should be the return for the
Subquery#getParent which is defined to return an AbstractQuery which
neither CriteriaUpdate/CriteriaDelete implement.
2) Seems to me we duplicate the effort to define the Root here; 2 calls
when one would suffice. First users pass the entity class to be
updated/deleted to the CriteriaBuilder method, then they have to call
one of the from() methods on CriteriaUpdate/CriteriaDelete. But unless
I miss something the actual "entity type" of the from argument has to be
the same as the one passed to CriteriaBuilder. Long story short, seems
to me that we could simply do away with the from() methods and remove
the need for the user to call the second method.