Author: dgeraskov
Date: 2010-05-13 02:52:51 -0400 (Thu, 13 May 2010)
New Revision: 22049
Modified:
branches/jbosstools-3.1.x/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java
branches/jbosstools-3.1.x/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java
branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6186
Modified:
branches/jbosstools-3.1.x/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java
===================================================================
---
branches/jbosstools-3.1.x/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java 2010-05-13
04:58:42 UTC (rev 22048)
+++
branches/jbosstools-3.1.x/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Shape.java 2010-05-13
06:52:51 UTC (rev 22049)
@@ -153,7 +153,8 @@
@Override
public String getKey() {
- return Utils.getName(getOrmElement());
+ //fix for
https://jira.jboss.org/jira/browse/JBIDE-6186
+ return Utils.getName(getOrmElement()).replaceAll("\\$", "..");
//$NON-NLS-1$ //$NON-NLS-2$
}
public void setFocus() {
Modified:
branches/jbosstools-3.1.x/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java
===================================================================
---
branches/jbosstools-3.1.x/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java 2010-05-13
04:58:42 UTC (rev 22048)
+++
branches/jbosstools-3.1.x/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/Utils.java 2010-05-13
06:52:51 UTC (rev 22049)
@@ -57,7 +57,7 @@
res = getTableName((Table)obj);
} else if (obj instanceof Property) {
Property property = (Property)obj;
- res = property.getPersistentClass().getEntityName() + "." +
property.getName(); //$NON-NLS-1$
+ res = getName(property.getPersistentClass()) + "." + property.getName();
//$NON-NLS-1$
} else if (obj instanceof SimpleValue) {
SimpleValue sv = (SimpleValue)obj;
res = getTableName(sv.getTable()) + "." + sv.getForeignKeyName();
//$NON-NLS-1$
Modified:
branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java
===================================================================
---
branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-05-13
04:58:42 UTC (rev 22048)
+++
branches/jbosstools-3.1.x/hibernatetools/tests/org.jboss.tools.hibernate.ui.test/src/org/jboss/tools/hibernate/ui/diagram/editors/model/test/OrmDiagramTest.java 2010-05-13
06:52:51 UTC (rev 22049)
@@ -47,20 +47,21 @@
rts.add(ioe);
final List<Object> emptyList = new ArrayList<Object>();
final Iterator<Object> emptyListIterator = emptyList.iterator();
-
+ //see
https://jira.jboss.org/jira/browse/JBIDE-6186
+ final String innerIntricateName = "myInner$Id";
context.checking(new Expectations() {
{
oneOf(ioe).getEntityName();
- will(returnValue("testEntityName")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
allowing(consoleConfig).getConfiguration();
will(returnValue(config));
oneOf(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
oneOf(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
oneOf(ioe).getIdentifierProperty();
will(returnValue(null));
@@ -93,7 +94,7 @@
will(returnValue("CCName")); //$NON-NLS-1$
allowing(ioe).getEntityName();
- will(returnValue("")); //$NON-NLS-1$
+ will(returnValue(innerIntricateName));
}
});
final OrmDiagram ormDiagram = new OrmDiagram("", rts) { //$NON-NLS-1$
@@ -101,7 +102,7 @@
return consoleConfig;
}
};
- ormDiagram.saveInFile();
+ ormDiagram.saveInXmlFile();
// test is the folder created
File folder = new File(ormDiagram.getStoreFolderPath().toOSString());
assertTrue(folder.exists() && folder.isDirectory());