ten24/Slatwall — Issue #532: Unable to apply addSelect() modifier to product smartList
Author: bhendel
Created: 2012-01-10 04:03:06+00:00
State: open

Any idea why running this:

rc.productSmartList = getProductService().getProductSmartList();
rc.productSmartList.addSelect(propertyIdentifier="productName", alias="name");
rc.productSmartList.addSelect(propertyIdentifier="productID", alias="value");

Produces:

query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=aslatwallbrand,role=null,tableName=SlatwallBrand,tableAlias=slatwallbr1_,origin=SlatwallProduct slatwallpr0_,columns={slatwallpr0_.brandID ,className=SlatwallBrand}}] [SELECT new map( aslatwallproduct.productName as name, aslatwallproduct.productID as value) FROM SlatwallProduct as aslatwallproduct inner join fetch aslatwallproduct.brand as aslatwallbrand inner join fetch aslatwallproduct.productType as aslatwallproducttype inner join fetch aslatwallproduct.defaultSku as aslatwallsku]

SELECT new map( aslatwallproduct.productName as name, aslatwallproduct.productID as value) FROM SlatwallProduct as aslatwallproduct inner join fetch aslatwallproduct.brand as aslatwallbrand inner join fetch aslatwallproduct.productType as aslatwallproducttype inner join fetch aslatwallproduct.defaultSku as aslatwallsku

org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=aslatwallbrand,role=null,tableName=SlatwallBrand,tableAlias=slatwallbr1_,origin=SlatwallProduct slatwallpr0_,columns={slatwallpr0_.brandID ,className=SlatwallBrand}}] [SELECT new map( aslatwallproduct.productName as name, aslatwallproduct.productID as value) FROM SlatwallProduct as aslatwallproduct inner join fetch aslatwallproduct.brand as aslatwallbrand inner join fetch aslatwallproduct.productType as aslatwallproducttype inner join fetch aslatwallproduct.defaultSku as aslatwallsku] at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:204) at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:844) at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:632) at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:678) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:294) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:237) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98) 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:1760) at coldfusion.orm.hibernate.SessionWrapper.createQuery(SessionWrapper.java:127) at coldfusion.orm.hibernate.HibernatePersistenceManager._executeHQL(HibernatePersistenceManager.java:762) at coldfusion.orm.hibernate.HibernatePersistenceManager.executeHQL(HibernatePersistenceManager.java:751) at coldfusion.orm.hibernate.HibernatePersistenceManager.executeQueryWithNamedParams(HibernatePersistenceManager.java:626) at coldfusion.orm.ORMUtils._executeQuery(ORMUtils.java:332) at coldfusion.orm.ORMUtils.executeQuery(ORMUtils.java:320) at coldfusion.runtime.CFPage.ORMExecuteQuery(CFPage.java:7805) at cfSmartList2ecfc108766338$funcGETRECORDS.runFunction(C:\PROJECTS\ten24\Slatwall\httpdocs\plugins\Slatwall\org\entitySmartList\SmartList.cfc:527) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at cfstockadjustment2ecfc688904183$funcINITSTOCKADJUSTMENT.runFunction(C:\PROJECTS\ten24\Slatwall\httpdocs\plugins\Slatwall\admin\controllers\stockadjustment.cfc:82) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at cfstockadjustment2ecfc688904183$funcCREATESTOCKADJUSTMENT.runFunction(C:\PROJECTS\ten24\Slatwall\httpdocs\plugins\Slatwall\admin\controllers\stockadjustment.cfc:119) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at Statement467.evaluate(:1) at coldfusion.compiler.ExprClassLoader.evaluate(ExprClassLoader.java:143) at coldfusion.runtime.CFPage.Evaluate(CFPage.java:1759) at cfframework2ecfc104437390$funcDOCONTROLLER.runFunction(C:\PROJECTS\ten24\Slatwall\httpdocs\plugins\Slatwall\org\fw1\framework.cfc:1110) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at cfframework2ecfc104437390$funcONREQUEST.runFunction(C:\PROJECTS\ten24\Slatwall\httpdocs\plugins\Slatwall\org\fw1\framework.cfc:623) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88) at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:280) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:356) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:94) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:200) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)