Author: mdryakhlenkov
Date: 2007-07-20 10:15:20 -0400 (Fri, 20 Jul 2007)
New Revision: 2552
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
Log:
EXIN-366: Adding elements on the diagram by double-click on fields of classes which have
additional information in mapping files
Open reference of subclass bug fixed
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-20
14:05:54 UTC (rev 2551)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-20
14:15:20 UTC (rev 2552)
@@ -23,6 +23,7 @@
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.DependantValue;
+import org.hibernate.mapping.Join;
import org.hibernate.mapping.KeyValue;
import org.hibernate.mapping.OneToMany;
import org.hibernate.mapping.PersistentClass;
@@ -215,6 +216,17 @@
}
OrmShape ownerTableShape =
getOrCreateDatabaseTable(((Subclass)element).getRootTable());
createConnections(subclassShape, ownerTableShape);
+
+ Iterator joinIterator = subclass.getJoinIterator();
+ while (joinIterator.hasNext()) {
+ Join join = (Join)joinIterator.next();
+ Iterator iterator = join.getPropertyIterator();
+ while (iterator.hasNext()) {
+ Property property = (Property)iterator.next();
+ OrmShape tableShape = getOrCreateDatabaseTable(property.getValue().getTable());
+ createConnections(subclassShape, tableShape);
+ }
+ }
}
}
@@ -230,6 +242,17 @@
}
}
}
+
+ Iterator joinIterator = persistentClass.getJoinIterator();
+ while (joinIterator.hasNext()) {
+ Join join = (Join)joinIterator.next();
+ Iterator iterator = join.getPropertyIterator();
+ while (iterator.hasNext()) {
+ Property property = (Property)iterator.next();
+ OrmShape tableShape = getOrCreateDatabaseTable(property.getValue().getTable());
+ createConnections(classShape, tableShape);
+ }
+ }
}
return classShape;
}
@@ -362,7 +385,7 @@
s.firePropertyChange(REFRESH, null, null);
}
} else if (clazz instanceof Subclass) {
- s = getOrCreatePersistentClass(((SingleTableSubclass)clazz).getRootClass(), null);
+ s = getOrCreatePersistentClass(((Subclass)clazz).getRootClass(), null);
}
}
} else {
Show replies by date