Author: dgeraskov
Date: 2009-12-29 10:05:07 -0500 (Tue, 29 Dec 2009)
New Revision: 19606
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5330
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2009-12-29
12:44:49 UTC (rev 19605)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2009-12-29
15:05:07 UTC (rev 19606)
@@ -40,19 +40,16 @@
* javaProjectName + "/" + fullyQualifiedName entity name -> EntityInfo
* this collection of processed entities
*/
- protected Map<String, EntityInfo> mapCUs_Info;
+ protected Map<String, EntityInfo> mapCUs_Info = new TreeMap<String,
EntityInfo>();
/**
* annotation style preference
*/
protected AnnotStyle annotationStylePreference = AnnotStyle.FIELDS;
-
- public AllEntitiesInfoCollector() {
- initCollector();
- }
+
public void initCollector() {
// clear collection
- mapCUs_Info = new TreeMap<String, EntityInfo>();
+ mapCUs_Info.clear();
}
/**
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-12-29
12:44:49 UTC (rev 19605)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-12-29
15:05:07 UTC (rev 19606)
@@ -142,7 +142,7 @@
processor.setEntityInfo(entry.getValue());
cu.accept(processor);
- }
+ }
}
Mappings mappings = config.createMappings();
@@ -210,7 +210,7 @@
}
private PersistentClass getMappedSuperclass(IJavaProject project, Map<String,
PersistentClass> persistentClasses, RootClass rootClass) throws JavaModelException{
- IType type = Utils.findType(project, rootClass.getClassName());
+ IType type = Utils.findType(project, rootClass.getClassName());
//TODO not direct superclass?
if (type.getSuperclassName() != null){
String[][] supertypes = type.resolveType(type.getSuperclassName());
@@ -257,13 +257,7 @@
TypeVisitor typeVisitor;
- /**
- * information about all entities
- */
- protected Map<String, EntityInfo> entities;
-
public void setEntities(Map<String, EntityInfo> entities) {
- this.entities = entities;
rootClasses.clear();
Iterator<Map.Entry<String, EntityInfo>> it =
entities.entrySet().iterator();
while (it.hasNext()) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-12-29
12:44:49 UTC (rev 19605)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-12-29
15:05:07 UTC (rev 19606)
@@ -16,6 +16,7 @@
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
@@ -362,7 +363,12 @@
collector.collect(icu);
}
collector.resolveRelations();
- project_infos.put(javaProject, collector.getMapCUs_Info().values());
+ Collection<EntityInfo> c = new ArrayList<EntityInfo>();
+ for (Iterator<EntityInfo> i = collector.getMapCUs_Info().values().iterator();
+ i.hasNext();) {
+ c.add(i.next());
+ }
+ project_infos.put(javaProject, c);
}
}