Author: mdryakhlenkov
Date: 2007-07-03 08:43:32 -0400 (Tue, 03 Jul 2007)
New Revision: 2253
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmShape.java
Log:
http://jira.jboss.org/jira/browse/EXIN-366
Merge changes in classes of diagram model from D.Azarov and me. Adding referenced object
for <any/> element.
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmDiagram.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmDiagram.java 2007-07-03
11:26:22 UTC (rev 2252)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmDiagram.java 2007-07-03
12:43:32 UTC (rev 2253)
@@ -185,8 +185,9 @@
Iterator iter = rc.getSubclassIterator();
while (iter.hasNext()) {
SingleTableSubclass singleTableSubclass = (SingleTableSubclass)iter.next();
- classShape =
elements.get(singleTableSubclass.getEntityPersisterClass().getCanonicalName());
- if (classShape == null) classShape = createShape(singleTableSubclass);
+ OrmShape singleTableSubclassShape =
elements.get(singleTableSubclass.getEntityPersisterClass().getCanonicalName());
+ if (singleTableSubclassShape == null) singleTableSubclassShape =
createShape(singleTableSubclass);
+ new Connection(singleTableSubclassShape, shape);
}
// if (persistentClass.getPersistentClassMapping() != null) {
// Iterator iter
=((IHibernateClassMapping)(persistentClass).getPersistentClassMapping()).getJoinIterator();
@@ -201,7 +202,6 @@
}
return classShape;
}
-
private OrmShape getOrCreateDatabaseTable(Table databaseTable){
OrmShape tableShape = null;
if(databaseTable != null) {
@@ -331,8 +331,13 @@
OrmShape childShape = getOrCreateDatabaseTable(map.getCollectionTable());
Shape keyShape =
childShape.getChild(((DependantValue)((Shape)componentShape.getChildren().get(0)).getOrmElement()).getColumnIterator().next());
new Connection((Shape)componentShape.getChildren().get(0), keyShape);
- Shape elementShape =
childShape.getChild(((SimpleValue)((Shape)componentShape.getChildren().get(1)).getOrmElement()).getColumnIterator().next());
- new Connection((Shape)componentShape.getChildren().get(1), elementShape);
+
+ Iterator iter =
((SimpleValue)((Shape)componentShape.getChildren().get(1)).getOrmElement()).getColumnIterator();
+ while (iter.hasNext()) {
+ Column col = (Column)iter.next();
+ Shape elementShape = childShape.getChild(col);
+ new Connection((Shape)componentShape.getChildren().get(1), elementShape);
+ }
}
setDirty(true);
firePropertyChange(REFRESH, null, null);
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmShape.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmShape.java 2007-07-03
11:26:22 UTC (rev 2252)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/veditor/editors/model/OrmShape.java 2007-07-03
12:43:32 UTC (rev 2253)
@@ -91,7 +91,7 @@
Property identifierProperty = rootClass.getIdentifierProperty();
if (identifierProperty != null) {
- shapes.add(new Shape(identifierProperty));
+ getChildren().add(new Shape(identifierProperty));
}
KeyValue identifier = rootClass.getIdentifier();
@@ -99,7 +99,7 @@
Iterator iterator = ((Component)identifier).getPropertyIterator();
while (iterator.hasNext()) {
Property property = (Property) iterator.next();
- shapes.add(new Shape(property));
+ getChildren().add(new Shape(property));
}
}
@@ -141,7 +141,7 @@
} else {
bodyOrmShape = new Shape(property);
}
- shapes.add(bodyOrmShape);
+ getChildren().add(bodyOrmShape);
}
} else if (ormElement instanceof Table) {
Iterator iterator = ((Table)getOrmElement()).getColumnIterator();