Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-10560

Inline evaluation error while using criteria editor with Hibernate 4

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 3.3.0.Beta1
    • 3.3.0.M5
    • hibernate
    • None
    • Hide

      1. Java Project,
      2. Hibernate 4 configuration, Core
      3. Open Hibernate Criteria Editor
      4. Use criteria:
      session.createCriteria(Customers.class)
      .setProjection(Property.forName("contactlastname").as("contactlastname"))
      .setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP)
      5. Define p as string and value 'abc' in Query Parameters view
      6. Run criteria
      ASSERT: criteria statement should be processed without errors and result should be visible

      Entities from HSQL DB 1.8, data
      http://anonsvn.jboss.org/repos/jbosstools/trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/sql/SQL%20Scrapbook%200

      Show
      1. Java Project, 2. Hibernate 4 configuration, Core 3. Open Hibernate Criteria Editor 4. Use criteria: session.createCriteria(Customers.class) .setProjection(Property.forName("contactlastname").as("contactlastname")) .setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP) 5. Define p as string and value 'abc' in Query Parameters view 6. Run criteria ASSERT: criteria statement should be processed without errors and result should be visible Entities from HSQL DB 1.8, data http://anonsvn.jboss.org/repos/jbosstools/trunk/hibernatetools/tests/org.jboss.tools.hibernate.ui.bot.test/resources/sql/SQL%20Scrapbook%200

    Description

      Sourced file: inline evaluation of: ``session.createCriteria(Customers.class) .setProjection(Property.forName("contact . . . '' : Error in method invocation: Method setProjection( org.hibernate.criterion.AliasedProjection ) not found in class'org.hibernate.internal.CriteriaImpl' : at Line: 2 : in file: inline evaluation of: ``session.createCriteria(Customers.class) .setProjection(Property.forName("contact . . . '' : .setProjection ( Property .forName ( "contactlastname" ) .as ( "contactlastname" ) )

      at bsh.BSHPrimarySuffix.doName(Unknown Source)
      at bsh.BSHPrimarySuffix.doSuffix(Unknown Source)
      at bsh.BSHPrimaryExpression.eval(Unknown Source)
      at bsh.BSHPrimaryExpression.eval(Unknown Source)
      at bsh.Interpreter.eval(Unknown Source)
      at bsh.Interpreter.eval(Unknown Source)
      at bsh.Interpreter.eval(Unknown Source)
      at org.jboss.tools.hibernate4_0.QueryExecutor.executeCriteriaQuery(QueryExecutor.java:79)
      at org.jboss.tools.hibernate4_0.HibernateExtension4_0.executeCriteriaQuery(HibernateExtension4_0.java:104)
      at org.hibernate.console.ext.JavaPage.updateQueryResults(JavaPage.java:55)
      at org.hibernate.console.ext.JavaPage.getList(JavaPage.java:46)
      at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:120)
      at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:1010)
      at org.eclipse.jface.viewers.ColumnViewer.getRawChildren(ColumnViewer.java:703)
      at org.eclipse.jface.viewers.AbstractTableViewer.getRawChildren(AbstractTableViewer.java:1087)
      at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:917)
      at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:1067)
      at org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:701)
      at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:649)
      at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:636)
      at org.eclipse.jface.viewers.AbstractTableViewer$2.run(AbstractTableViewer.java:592)
      at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1443)
      at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1404)
      at org.eclipse.jface.viewers.AbstractTableViewer.inputChanged(AbstractTableViewer.java:590)
      at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280)
      at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1690)
      at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:225)
      at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:203)
      at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:160)
      at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:109)
      at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:75)
      at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:85)
      at javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:130)
      at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:67)
      at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:88)
      at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:326)
      at org.hibernate.console.ConsoleConfiguration.access$4(ConsoleConfiguration.java:324)
      at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:300)
      at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
      at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
      at org.hibernate.console.ConsoleConfiguration.executeBSHQuery(ConsoleConfiguration.java:296)
      at org.hibernate.eclipse.criteriaeditor.CriteriaEditor.executeQuery(CriteriaEditor.java:146)
      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:1258)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
      at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
      at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
      at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
      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:344)
      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:622)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

      Attachments

        Activity

          People

            dgeraskov Dmitry Geraskov (Inactive)
            jpeterka_jira Jiri Peterka (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: