Author: mdryakhlenkov
Date: 2007-08-03 11:43:36 -0400 (Fri, 03 Aug 2007)
New Revision: 2888
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/parts/DiagramEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
Log:
EXIN-413: Incorrect relations between elements of diagram
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-08-03
14:50:40 UTC (rev 2887)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-08-03
15:43:36 UTC (rev 2888)
@@ -127,7 +127,7 @@
if (ormElement instanceof RootClass) {
childrenLocations[i] = ((RootClass)ormElement).getEntityName() + "@";
} else if (ormElement instanceof Table) {
- childrenLocations[i] = ((Table)ormElement).getSchema() + "." +
((Table)ormElement).getName()+"@";
+ childrenLocations[i] = TextUtil.getTableName((Table)ormElement)+"@";
// } else if (ormElement instanceof Component) {
// childrenLocations[i] = ((Component)ormElement).getComponentClassName()+"@";
}
@@ -292,9 +292,6 @@
if (elements.get(cls.getEntityName()) == null)
getOrCreatePersistentClass(cls, null);
}
-// } else if (clazz instanceof SingleTableSubclass) {
-// SingleTableSubclass singleTableSubclass = (SingleTableSubclass)clazz;
-// getOrCreatePersistentClass(singleTableSubclass, null);
}
}
}
@@ -497,7 +494,7 @@
Component component = (Component)((Collection)property.getValue()).getElement();
if (component != null) {
classShape = createShape(property);
- OrmShape tableShape = (OrmShape)elements.get(component.getTable().getSchema() +
"." + component.getTable().getName());
+ OrmShape tableShape =
(OrmShape)elements.get(TextUtil.getTableName(component.getTable()));
if (tableShape == null) tableShape =
getOrCreateDatabaseTable(component.getTable());
createConnections(classShape, tableShape);
if(!isConnectionExist(classShape, tableShape)){
@@ -527,9 +524,10 @@
OrmShape classShape = null;
OneToMany component = (OneToMany)((Collection)property.getValue()).getElement();
if (component != null) {
- classShape = (OrmShape)elements.get(component.getAssociatedClass().getEntityName());
+// classShape =
(OrmShape)elements.get(component.getAssociatedClass().getEntityName());
+ classShape = getOrCreatePersistentClass(component.getAssociatedClass(), null);
if (classShape == null) classShape = createShape(component.getAssociatedClass());
- OrmShape tableShape =
(OrmShape)elements.get(component.getAssociatedClass().getTable().getSchema() +
"." + component.getAssociatedClass().getTable().getName());
+ OrmShape tableShape =
(OrmShape)elements.get(TextUtil.getTableName(component.getAssociatedClass().getTable()));
if (tableShape == null) tableShape =
getOrCreateDatabaseTable(component.getAssociatedClass().getTable());
createConnections(classShape, tableShape);
if(!isConnectionExist(classShape, tableShape)){
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java 2007-08-03
14:50:40 UTC (rev 2887)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/DiagramEditPart.java 2007-08-03
15:43:36 UTC (rev 2888)
@@ -152,8 +152,7 @@
.getOrmElement())).getProperty().getValue())
.getElement();
Table ownerTable = component.getOwner().getTable();
- ormShape = (OrmShape) hashMap.remove(ownerTable.getSchema()
- + "." + ownerTable.getName());
+ ormShape = (OrmShape) hashMap.remove(TextUtil.getTableName(ownerTable));
// }
// if (ormShape != null ) {
// ormShape.setLocation(new Point(pointX,point));
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-08-03
14:50:40 UTC (rev 2887)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-08-03
15:43:36 UTC (rev 2888)
@@ -67,7 +67,7 @@
((ExpandeableShape)getModel()).refreshReferences(getViewer().getContents().getModel());
}
}
-
+
public void propertyChange(PropertyChangeEvent evt) {
String prop = evt.getPropertyName();
if (Shape.SHOW_SELECTION.equals(prop)) {
Show replies by date