Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312255 - JPA:Core: Use generics in Session/Project Maps to avoid casting
Summary: JPA:Core: Use generics in Session/Project Maps to avoid casting
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-10 09:56 EDT by Michael OBrien CLA
Modified: 2022-06-09 10:28 EDT (History)
1 user (show)

See Also:


Attachments
Example refactor of descriptor Map in Project via Session (4.57 KB, patch)
2010-05-10 09:58 EDT, Michael OBrien CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael OBrien CLA 2010-05-10 09:56:54 EDT
>To aide in using Session and Project API with code that is already using generics - 
>we should update this the remaining Map and List instance variables to use generics
- This will possibly involve a deprecation phase first
  Map descriptors;
  Map aliasDescriptors;
- some of the API is already using generics
  Map<String, String> staticMetamodelClasses
  Map<Object, RelationalDescriptor> mappedSuperclassDescriptors;
  Map<String, List<String>> metamodelIdClassMap;
- some generics change will be redundant if the key is Object for instance

protected transient List<DatabaseQuery> queries = null;
>Example: in the following CacheImpl JPA code we need to workaround the missing generic structure in AbstractSession and Project

>before generics
  Iterator<ClassDescriptor> descriptorIterator = getSession().getDescriptors().values().iterator();
    while(descriptorIterator.hasNext()) {
      ClassDescriptor candidateAssignableDescriptor = descriptorIterator.next();

>after generics
  for(ClassDescriptor candidateAssignableDescriptor : getSession().getDescriptors().values()) {
Comment 1 Michael OBrien CLA 2010-05-10 09:58:44 EDT
Created attachment 167705 [details]
Example refactor of descriptor Map in Project via Session
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:28:53 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink