Author: max.andersen(a)jboss.com
Date: 2007-11-08 09:37:16 -0500 (Thu, 08 Nov 2007)
New Revision: 4788
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java
Log:
fixed broken lookup - root class looked for any "class" attribute reference
which would give us the first file that *refer* to the mapping instead of the actual
definition.
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java 2007-11-08
13:47:04 UTC (rev 4787)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java 2007-11-08
14:37:16 UTC (rev 4788)
@@ -87,16 +87,16 @@
}
}
+ // TODO: this is *extremely* inefficient - no need to scan the whole tree again and
again.
private static boolean rootClassInResource(ConsoleConfiguration consoleConfiguration,
IResource resource, RootClass persistentClass) {
Document doc = getDocument(consoleConfiguration, resource.getLocation().toFile());
return getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS, HIBERNATE_TAG_NAME,
StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS, HIBERNATE_TAG_NAME,
getPersistentClassName(persistentClass)).hasNext() ||
- getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS,
StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS,
getPersistentClassName(persistentClass)).hasNext() ||
getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS, HIBERNATE_TAG_ENTITY_NAME,
StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS, HIBERNATE_TAG_ENTITY_NAME,
getPersistentClassName(persistentClass)).hasNext();
}
+ // TODO: this is *extremely* inefficient - no need to scan the whole tree again and
again.
private static boolean subclassInResource(ConsoleConfiguration consoleConfiguration,
IResource resource, Subclass persistentClass) {
Document doc = getDocument(consoleConfiguration, resource.getLocation().toFile());
return getElements(doc, HIBERNATE_TAG_SUBCLASS, HIBERNATE_TAG_NAME,
StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
@@ -107,7 +107,7 @@
getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_NAME,
StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_NAME,
getPersistentClassName(persistentClass)).hasNext() ||
getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME,
StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME,
getPersistentClassName(persistentClass)).hasNext() ||
+ getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME,
getPersistentClassName(persistentClass)).hasNext() ||
getElements(doc, HIBERNATE_TAG_UNION_SUBCLASS, HIBERNATE_TAG_NAME,
StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
getElements(doc, HIBERNATE_TAG_UNION_SUBCLASS, HIBERNATE_TAG_NAME,
getPersistentClassName(persistentClass)).hasNext() ||