Author: vyemialyanchyk
Date: 2009-04-29 13:34:26 -0400 (Wed, 29 Apr 2009)
New Revision: 14965
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4252
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2009-04-29
17:04:11 UTC (rev 14964)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2009-04-29
17:34:26 UTC (rev 14965)
@@ -24,6 +24,7 @@
import org.eclipse.jface.viewers.TreePath;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
+import org.hibernate.console.node.BaseNode;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
@@ -70,6 +71,13 @@
}
return "select o." + prName + " from " + enName + " o";
//$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
}
+ else if (node instanceof BaseNode) {
+ BaseNode baseNode = (BaseNode)node;
+ ConsoleConfiguration consoleConfiguration = baseNode.getConsoleConfiguration();
+ if (consoleConfiguration.isSessionFactoryCreated()) {
+ return baseNode.getHQL();
+ }
+ }
return ""; //$NON-NLS-1$
}
}
\ No newline at end of file