Title:
Bug 81261:Queries created using EntityToQuery() throw errors when trying to use Query of Queries
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Mike Nicholls / Mike Nicholls (mikenicholls)
Created: 12/20/2009
Components: ORM Support
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 9,0,0,251028 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Platforms All
Vote Count: 0
Problem:
Queries created using EntityToQuery() throw errors when trying to use Query of Queries
Method:
Application.cfc---------------<cfcomponent><cfset this.name = "ORMTest"><cfset this.datasource = "YOUR_DATASOURCE_HERE"><cfset this.ormEnabled = true><cfset this.ormSettings = {dbCreate="update"}></cfcomponent>TestEntity.cfc--------------<cfcomponent persistent="true"><cfproperty name="id" fieldType="id" generator="identity"></cfcomponent>index.cfm---------<!--- create some test data ---><cfloop from="1" to="5" index="i"><cfset test = new TestEntity()><cfset EntitySave(test)></cfloop><cfset ORMFlush()><!--- load the test data ---><cfset myEntities = EntityLoad("TestEntity")><!--- turn it into a query ---><cfset myQuery = EntityToQuery(myEntities)><!--- try querying it with QoQ ---><cfquery name="testQuery" dbtype="query">SELECT * FROM myQuery;</cfquery>
Result:
java.lang.ArrayIndexOutOfBoundsException: 0at coldfusion.sql.QueryTableMetaData.getColumnName(QueryTableMetaData.java:671)at coldfusion.sql.imq.ColumnMetaData.<init>(ColumnMetaData.java:34)at coldfusion.sql.imq.StarColumn.validate(SelectColumn.java:87)at coldfusion.sql.imq.SelectColumnList.validate(SelectColumnList.java:173)at coldfusion.sql.imq.rttSelectExprSpec.validate(rttSelectExprSpec.java:518)at coldfusion.sql.imq.rttSelectStmt.validate(rttSelectStmt.java:84)at coldfusion.sql.imq.jdbcStatement.fetchResult(jdbcStatement.java:538)at coldfusion.sql.imq.jdbcStatement.execute(jdbcStatement.java:131)at coldfusion.sql.Executive.executeQuery(Executive.java:1239)at coldfusion.sql.SqlImpl.execute(SqlImpl.java:345)at coldfusion.tagext.sql.QueryTag.executeQuery(QueryTag.java:843)at coldfusion.tagext.sql.QueryTag.doEndTag(QueryTag.java:533)at cfindex2ecfm1016205949.runPage(F:\inetpub\wwwroot\mikedev\ormTest\index.cfm:12)at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:342)at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)at coldfusion.filter.PathFilter.invoke(PathFilter.java:87)at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)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:53)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)
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3040655
External Customer Info:
External Company:
External Customer Name: Mike Nicholls
External Customer Email: 1932664644160A2F992015D5
External Test Config: 12/20/2009
Attachments:
Comments: