Community
Participate
Working Groups
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.
>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
This feature is currently underdevelopment and some parts are not yet complete. This issue has recently been implemented.
>See SVN Rev# 5303 for the Metamodel API specific parts http://fisheye2.atlassian.com/changelog/eclipselink/?cs=5303
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink