facebook

[Closed] HQL Editor – fetch may not be used with scroll()

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #259487 Reply

    idfbins
    Member

    I am trying to execute a query using the HQL editor. When I do I get the following error:

    org.Hibernate.QueryException: fetch may not be used with scroll() or iterate().

    My HQL is as follows:

    
    select distinct p from Client p 
    join fetch p.policies policy 
    left join fetch p.entityLocations entityLocation 
    left join fetch entityLocation.locationType 
    left join fetch entityLocation.location location 
    where (p.search like 'DOE%') 
    

    I am trying to use the query above to override the defaul lazy=true. Is there a way I can get a “join fetch” to work in the HQL editor?

    #259529 Reply

    Haris Peco
    Member

    idfbins ,

    You can’t set fetching query (scroll, iterate or list) currently.However, MyEclipse use list
    Please, can you send complete log

    Thanks
    Peco

    #259546 Reply

    idfbins
    Member

    Peco,

    Didn’t quite understand your last sentence:

    “However, MyEclipse use list Please, can you send complete log ”

    Can you please re-phrase? Where can I find the MyEclipse HQL Editor log?

    #259548 Reply

    Haris Peco
    Member

    It is Windows – Show view – Other – PDE Runtime – Error Log view

    my explanation : you can’t use fetch join with iterate or scroll in hibernate.MyEclipse use query.list().iterator() – it is not iterate, but hibernate can’t use fetch join
    I will check your problem more when you send me log

    Thanks
    Peco

    #259550 Reply

    idfbins
    Member

    Here is the log:

    
    eclipse.buildId=M20060629-1905
    java.version=1.5.0_06
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Framework arguments:  -product com.genuitec.myeclipse.product.ide
    Command-line arguments:  -os win32 -ws win32 -arch x86 -product com.genuitec.myeclipse.product.ide
    
    Error
    Fri Sep 29 08:53:29 MDT 2006
    Exception while executing HQL Query
    
    eclipse.buildId=M20060629-1905
    java.version=1.5.0_06
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Framework arguments:  -product com.genuitec.myeclipse.product.ide
    Command-line arguments:  -os win32 -ws win32 -arch x86 -product com.genuitec.myeclipse.product.ide
    
    Error
    Fri Sep 29 08:53:29 MDT 2006
    org.hibernate.QueryException: fetch may not be used with scroll() or iterate() [select distinct p from com.idfbins.domain.busent.Client pjoin fetch p.policies policy
    left join fetch p.entityLocations entityLocation
    left join fetch entityLocation.locationType
    left join fetch entityLocation.location location
    where (p.search like 'FRANKMAN%')
    ]
    
    org.hibernate.QueryException: fetch may not be used with scroll() or iterate() [select distinct p from com.idfbins.domain.busent.Client p
    join fetch p.policies policy
    left join fetch p.entityLocations entityLocation
    left join fetch entityLocation.locationType
    left join fetch entityLocation.location location
    where (p.search like 'FRANKMAN%')
    ]
    at org.hibernate.hql.ast.tree.FromElement.setFetch(FromElement.java:391)
    at org.hibernate.hql.ast.tree.FromElementFactory.createCollection(FromElementFactory.java:218)
    at org.hibernate.hql.ast.tree.DotNode.dereferenceCollection(DotNode.java:262)
    at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:200)
    at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
    at org.hibernate.hql.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:313)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3268)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3060)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2938)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
    at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
    at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
    at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
    at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
    at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
    at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
    at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
    at org.hibernate.impl.SessionFactoryImpl.getReturnAliases(SessionFactoryImpl.java:622)
    at org.hibernate.impl.AbstractQueryImpl.getReturnAliases(AbstractQueryImpl.java:156)
    at org.hibernate.console.HQLQueryPage.getPathNames(HQLQueryPage.java:95)
    at org.hibernate.eclipse.console.views.QueryPageViewer.addColumnsToTable(QueryPageViewer.java:215)
    at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:170)
    at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153)
    at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111)
    at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:90)
    at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:54)
    at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:64)
    at javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:130)
    at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
    at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:61)
    at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:319)
    at org.hibernate.console.ConsoleConfiguration.access$1(ConsoleConfiguration.java:315)
    at org.hibernate.console.ConsoleConfiguration$4.run(ConsoleConfiguration.java:305)
    at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:155)
    at org.eclipse.ui.internal.UISynchronizer$1.run(UISynchronizer.java:36)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    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:585)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)
    #259583 Reply

    Haris Peco
    Member

    idfbins ,

    Unfortunately, you can’t use fetch join in legacy sql editor.We will relax this constraint in future release

    Thank you for feedback and sorry for the inconvenience caused

    Regards
    Peco

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: [Closed] HQL Editor – fetch may not be used with scroll()

You must be logged in to post in the forum log in