This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 289817 - CriteriaQuery.subquery() throws UnsupportedOperationException
Summary: CriteriaQuery.subquery() throws UnsupportedOperationException
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-18 04:23 EDT by Raja Perumal CLA
Modified: 2022-06-09 10:34 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Raja Perumal CLA 2009-09-18 04:23:39 EDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.14) Gecko/2009082706 Firefox/3.0.14
Build Identifier: 20090916

        EntityManager em = getEntityManager();
        EntityManagerFactory emf = em.getEntityManagerFactory();
        QueryBuilder qbuilder = emf.getQueryBuilder();

        EntityTransaction et = getEntityTransaction();

        et.begin();
        CriteriaQuery<Integer> cquery = qbuilder.createQuery(Integer.class);
        if (cquery != null) {
            Root<HardwareProduct> hardProd = cquery.from(HardwareProduct.class);

            //Get Metamodel from Root
            EntityType<HardwareProduct> HardwareProduct_ = hardProd.getModel();

            // following line throws UnsupportedOperationException
            Subquery<Integer> sq = cquery.subquery(Integer.class);

Reproducible: Always

Steps to Reproduce:
1. Try the code in Details section.
Comment 1 Michael OBrien CLA 2009-09-21 16:14:23 EDT
>If the UOE is for Metamodel API referenced by SubQueryImpl.select():102 - IdentifiableType.hasSingleIdAttribute() or IdentifiableType.getIdClassAttributes - these functions are in mid-implementation.
Their schedule and initial implementation progress can be followed in the following design issues sections on the Metamodel API wiki.

http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_73:_20090909:_Implement_IdentifiableType.getIdClassAttributes.28.29
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_74:_20090909:_Implement_IdentifiableType.hasSingleIdAttribute.28.29
Comment 2 Gordon Yorke CLA 2009-09-23 13:23:12 EDT
This feature is currently underdevelopment and some parts are not yet complete.  This issue has recently been implemented.
Comment 3 Michael OBrien CLA 2009-09-25 14:05:27 EDT
>See SVN Rev# 5303 for the Metamodel API specific parts
http://fisheye2.atlassian.com/changelog/eclipselink/?cs=5303
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:14:50 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:34:21 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink