| Summary: | More type safety of DynamicType | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Frank Schwarz <fs5> | ||||
| Component: | Eclipselink | Assignee: | Mike Norman <michael.norman> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | michael.f.obrien, michael.norman, tom.ware | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | submitted_patch dynamic | ||||||
| Attachments: |
|
||||||
Created attachment 177427 [details]
Proposed change
set (tentatively) for inclusion in 2.2 Frank - thank you very much for your constructive feedback! checked into TRUNK (2.2 stream) SVN revision: 8153 - all core, JPA and Dynamic JAXB tests pass The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
Build Identifier: trunk (2.2.0) Please consider making DynamicType more type-safe, in particular the method "getJavaType": public Class<? extends DynamicEntity> getJavaClass(); vs. public Class<?> getJavaClass(); This would allow code like this: CriteriaBuilder criteriaBuilder = entityManagerFactory.getCriteriaBuilder(); CriteriaQuery<DynamicEntity> criteriaQuery = criteriaBuilder.createQuery(DynamicEntity.class); Root<? extends DynamicEntity> personR = criteriaQuery.from(helper.getType("Person").getJavaClass()); criteriaQuery.select(personR); TypedQuery<DynamicEntity> query = entityManager.createQuery(criteriaQuery); instead of this: CriteriaBuilder criteriaBuilder = entityManagerFactory.getCriteriaBuilder(); CriteriaQuery<DynamicEntity> criteriaQuery = criteriaBuilder.createQuery(DynamicEntity.class); @SuppressWarnings("unchecked") Root<DynamicEntity> personR = (Root<DynamicEntity>) criteriaQuery.from(helper.getType("Person").getJavaClass()); criteriaQuery.select(personR); TypedQuery<DynamicEntity> query = entityManager.createQuery(criteriaQuery); Please close this feature request if I am mistaken on the nature of DynamicType/DynamicEntity. Reproducible: Always