4 Replies Latest reply on Sep 2, 2010 5:32 AM by nimo22

    hql editor comments

    nimo22

      Does rf-tools support comments in hql-editor?

       

      For example, I write in the hql editor:

       

      line 1: --select DAYNAME(timestamp) from Dates a

      line 3: -- this is a comment

      line 2: select DAY(timestamp) from Dates a

       

      so you see, the first and second line should be ignored.

       

      But it does not work.

       

      I get this failure:


      java.lang.IllegalArgumentException: node to traverse cannot be null!
      at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:55)
      at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:280)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
      at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
      at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
      at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
      at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
      at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
      at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1651)
      at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:105)
      at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:271)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
      at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:71)
      at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:267)
      at org.hibernate.eclipse.hqleditor.HQLEditor.executeQuery(HQLEditor.java:449)
      at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:84)
      at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:55)
      at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
      at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:59)
      at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
      at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
      at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
      at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
      at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
      at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1383)