-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: createSQLQuery mapping to wrong table name
PostPosted: Mon Sep 27, 2004 7:15 pm 
Newbie

Joined: Mon Sep 27, 2004 6:49 pm
Posts: 3
The table name is actually sales_total_block_data, but it tries to use the alias name directly. What am I doing wrong?

Hibernate version:
Hibernate 2.1.6 (09.08.2004) production

Mapping documents:

<class name="com.perfretail.k2v1.trackers.sales.SalesTotalBlock" table="sales_total_block_data" discriminator-value="BLOCK">

<id name="id" type="string" unsaved-value="null" >
<column name="UUID" sql-type="char(32)" not-null="true"/>
<generator class="assigned"/>
</id>
<discriminator column="TYPE" type="string"/>
<property name="chainUuid" type="com.perfretail.k2v1.uuids.ChainUuidType">
<column name="CHAIN_UUID"></column>
</property>
<property name="siteUuid" type="com.perfretail.k2v1.uuids.SiteUuidType">
<column name="SITE_UUID"></column>
</property>
<property name="name" type="string">
<column name="NAME"></column>
</property>
<property name="description" type="string">
<column name="DESCRIPTION"></column>
</property>
<property name="period" type="string">
<column name="PERIOD"></column>
</property>
<property name="timeStamp" type="long">
<column name="TIMESTAMP"></column>
</property>
<property name="creationTime" type="long">
<column name="CREATIONTIME"></column>
</property>
<property name="status" type="string">
<column name="STATUS"></column>
</property>

<subclass name="com.perfretail.k2v1.trackers.sales.SalesRollupBlock" discriminator-value="ROLLUP" >
<property name="sourcePeriod" type="string">
<column name="SRCPERIOD"></column>
</property>
</subclass>

</class>

Code between sessionFactory.openSession() and session.close():

Query q = getSession().createSQLQuery("select {stb.*} from stb {stb}", "stb", SalesTotalBlock.class); try {
List list = q.list();
for( Iterator ii=list.iterator(); ii.hasNext(); ) {
System.out.println( "next list " + ii.next().getClass().getName() );
}
} catch (HibernateException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}


Full stack trace of any exception that occurs:

Hibernate: select stb.UUID as UUID0_, stb.TYPE as TYPE0_, stb.CHAIN_UUID as CHAI
N_UUID0_, stb.SITE_UUID as SITE_UUID0_, stb.NAME as NAME0_, stb.DESCRIPTION as D
ESCRIPT6_0_, stb.PERIOD as PERIOD0_, stb.TIMESTAMP as TIMESTAMP0_, stb.CREATIONT
IME as CREATION9_0_, stb.STATUS as STATUS0_, stb.SRCPERIOD as SRCPERIOD0_ from s
tb stb
2004-09-27 17:59:36,231 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQ
L Error: 1146, SQLState: S1000>
2004-09-27 17:59:36,231 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <G
eneral error, message from server: "Table 'k2v01.stb' doesn't exist">
2004-09-27 17:59:36,241 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQ
L Error: 1146, SQLState: S1000>
2004-09-27 17:59:36,251 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <G
eneral error, message from server: "Table 'k2v01.stb' doesn't exist">
2004-09-27 17:59:36,272 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <S
QLException occurred>
java.sql.SQLException: General error, message from server: "Table 'k2v01.stb' d
oesn't exist"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1977)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:
1555)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(Dele
gatingPreparedStatement.java:92)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3806)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at com.perfretail.k2v1.trackers.sales.SalesTotalTableModelProvider.getMo
del(SalesTotalTableModelProvider.java:80)
at gjdk.com.perfretail.k2v1.trackers.sales.SalesTotalTableModelProvider_
GroovyReflector.invoke(SalesTotalTableModelProvider_GroovyReflector.java)
at groovy.lang.MetaMethod.invoke(MetaMethod.java:110)
at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:1372)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:316)
at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:143)
at org.codehaus.groovy.runtime.InvokerHelper.invokeNoArgumentsMethod(Inv
okerHelper.java:102)
at script1096325963343.run(script1096325963343.groovy:31)
at gjdk.script1096325963343_GroovyReflector.invoke(script1096325963343_G
roovyReflector.java)
at groovy.lang.MetaMethod.invoke(MetaMethod.java:110)
at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:1372)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:316)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:301)
at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java
:73)
at com.perfretail.k2v1.webapp1.web.admin.scripts.AdminScriptsController.
referenceData(AdminScriptsController.java:130)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.refe
renceData(AbstractWizardFormController.java:232)
at org.springframework.web.servlet.mvc.AbstractFormController.showForm(A
bstractFormController.java:365)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.show
Page(AbstractWizardFormController.java:303)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.show
Form(AbstractWizardFormController.java:275)
at org.springframework.web.servlet.mvc.AbstractFormController.showNewFor
m(AbstractFormController.java:284)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequ
estInternal(AbstractFormController.java:240)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(
AbstractController.java:121)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.ha
ndle(SimpleControllerHandlerAdapter.java:44)
at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
rServlet.java:495)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkSer
vlet.java:321)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.proceedW
ithObject(FilterSecurityInterceptor.java:87)
at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.intercepto
r(AbstractSecurityInterceptor.java:318)
at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(F
ilterSecurityInterceptor.java:78)
at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter
(SecurityEnforcementFilter.java:165)
at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProx
y.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at net.sf.acegisecurity.ui.AbstractIntegrationFilter.doFilter(AbstractIn
tegrationFilter.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractPro
cessingFilter.java:260)
at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProx
y.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:256)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
ContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:21
1)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:805)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:696)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:677)
at java.lang.Thread.run(Thread.java:534)
net.sf.hibernate.JDBCException: SQLException occurred
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3809)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at com.perfretail.k2v1.trackers.sales.SalesTotalTableModelProvider.getMo
del(SalesTotalTableModelProvider.java:80)
at gjdk.com.perfretail.k2v1.trackers.sales.SalesTotalTableModelProvider_
GroovyReflector.invoke(SalesTotalTableModelProvider_GroovyReflector.java)
at groovy.lang.MetaMethod.invoke(MetaMethod.java:110)
at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:1372)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:316)
at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:143)
at org.codehaus.groovy.runtime.InvokerHelper.invokeNoArgumentsMethod(Inv
okerHelper.java:102)
at script1096325963343.run(script1096325963343.groovy:31)
at gjdk.script1096325963343_GroovyReflector.invoke(script1096325963343_G
roovyReflector.java)
at groovy.lang.MetaMethod.invoke(MetaMethod.java:110)
at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:1372)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:316)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:301)
at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java
:73)
at com.perfretail.k2v1.webapp1.web.admin.scripts.AdminScriptsController.
referenceData(AdminScriptsController.java:130)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.refe
renceData(AbstractWizardFormController.java:232)
at org.springframework.web.servlet.mvc.AbstractFormController.showForm(A
bstractFormController.java:365)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.show
Page(AbstractWizardFormController.java:303)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.show
Form(AbstractWizardFormController.java:275)
at org.springframework.web.servlet.mvc.AbstractFormController.showNewFor
m(AbstractFormController.java:284)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequ
estInternal(AbstractFormController.java:240)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(
AbstractController.java:121)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.ha
ndle(SimpleControllerHandlerAdapter.java:44)
at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
rServlet.java:495)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkSer
vlet.java:321)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.proceedW
ithObject(FilterSecurityInterceptor.java:87)
at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.intercepto
r(AbstractSecurityInterceptor.java:318)
at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(F
ilterSecurityInterceptor.java:78)
at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter
(SecurityEnforcementFilter.java:165)
at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProx
y.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at net.sf.acegisecurity.ui.AbstractIntegrationFilter.doFilter(AbstractIn
tegrationFilter.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractPro
cessingFilter.java:260)
at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProx
y.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:256)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
ContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:21
1)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:805)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:696)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:677)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.sql.SQLException: General error, message from server: "Table 'k
2v01.stb' doesn't exist"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1977)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:
1555)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(Dele
gatingPreparedStatement.java:92)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3806)
... 65 more
Name and version of the database you are using:

The generated SQL (show_sql=true):
Hibernate: select stb.UUID as UUID0_, stb.TYPE as TYPE0_, stb.CHAIN_UUID as CHAI
N_UUID0_, stb.SITE_UUID as SITE_UUID0_, stb.NAME as NAME0_, stb.DESCRIPTION as D
ESCRIPT6_0_, stb.PERIOD as PERIOD0_, stb.TIMESTAMP as TIMESTAMP0_, stb.CREATIONT
IME as CREATION9_0_, stb.STATUS as STATUS0_, stb.SRCPERIOD as SRCPERIOD0_ from s
tb stb
2004-09-27 17:59:36,231 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQ
L Error: 1146, SQLState: S1000>
2004-09-27 17:59:36,231 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <G
eneral error, message from server: "Table 'k2v01.stb' doesn't exist">
2004-09-27 17:59:36,241 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQ
L Error: 1146, SQLState: S1000>
2004-09-27 17:59:36,251 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <G
eneral error, message from server: "Table 'k2v01.stb' doesn't exist">
2004-09-27 17:59:36,272 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <S
QLException occurred>
java.sql.SQLException: General error, message from server: "Table 'k2v01.stb' d
oesn't exist"

Debug level Hibernate log excerpt:
2004-09-27 18:06:53,813 DEBUG [net.sf.hibernate.impl.SessionImpl] - <opened session>
2004-09-27 18:06:53,843 DEBUG [net.sf.hibernate.impl.SessionImpl] - <SQL query: select {stb.*} from stb {stb}>
2004-09-27 18:06:53,853 DEBUG [net.sf.hibernate.impl.SessionImpl] - <flushing session>
2004-09-27 18:06:53,863 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Flushing entities and processing referenced collections>
2004-09-27 18:06:53,863 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Processing unreferenced collections>
2004-09-27 18:06:53,863 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Scheduling collection removes/(re)creates/updates>
2004-09-27 18:06:53,863 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects>
2004-09-27 18:06:53,863 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections>
2004-09-27 18:06:53,873 DEBUG [net.sf.hibernate.impl.SessionImpl] - <Dont need to execute flush>
2004-09-27 18:06:53,873 DEBUG [net.sf.hibernate.impl.BatcherImpl] - <about to open: 0 open PreparedStatements, 0 open ResultSets>
2004-09-27 18:06:53,873 DEBUG [net.sf.hibernate.SQL] - <select stb.UUID as UUID0_, stb.TYPE as TYPE0_, stb.CHAIN_UUID as CHAIN_UUID0_, stb.SITE_UUID as SITE_UUID0_, stb.NAME as NAME0_, stb.DESCRIPTION as DESCRIPT6_0_, stb.PERIOD as PERIOD0_, stb.TIMESTAMP as TIMESTAMP0_, stb.CREATIONTIME as CREATION9_0_, stb.STATUS as STATUS0_, stb.SRCPERIOD as SRCPERIOD0_ from stb stb>
2004-09-27 18:06:53,883 DEBUG [net.sf.hibernate.impl.BatcherImpl] - <preparing statement>
2004-09-27 18:06:53,923 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Exception>
java.sql.SQLException: General error, message from server: "Table 'k2v01.stb' doesn't exist"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1977)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1163)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1272)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2236)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1555)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3806)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at com.perfretail.k2v1.trackers.sales.SalesTotalTableModelProvider.getModel(SalesTotalTableModelProvider.java:80)
at gjdk.com.perfretail.k2v1.trackers.sales.SalesTotalTableModelProvider_GroovyReflector.invoke(SalesTotalTableModelProvider_GroovyReflector.java)
at groovy.lang.MetaMethod.invoke(MetaMethod.java:110)
at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:1372)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:316)
at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:143)
at org.codehaus.groovy.runtime.InvokerHelper.invokeNoArgumentsMethod(InvokerHelper.java:102)
at script1096326410338.run(script1096326410338.groovy:31)
at gjdk.script1096326410338_GroovyReflector.invoke(script1096326410338_GroovyReflector.java)
at groovy.lang.MetaMethod.invoke(MetaMethod.java:110)
at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:1372)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:316)
at groovy.lang.MetaClass.invokeMethod(MetaClass.java:301)
at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:73)
at com.perfretail.k2v1.webapp1.web.admin.scripts.AdminScriptsController.referenceData(AdminScriptsController.java:130)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.referenceData(AbstractWizardFormController.java:232)
at org.springframework.web.servlet.mvc.AbstractFormController.showForm(AbstractFormController.java:365)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.showPage(AbstractWizardFormController.java:303)
at org.springframework.web.servlet.mvc.AbstractWizardFormController.showForm(AbstractWizardFormController.java:275)
at org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:284)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:240)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:121)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:495)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:321)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.proceedWithObject(FilterSecurityInterceptor.java:87)
at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.interceptor(AbstractSecurityInterceptor.java:318)
at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:78)
at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:165)
at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at net.sf.acegisecurity.ui.AbstractIntegrationFilter.doFilter(AbstractIntegrationFilter.java:120)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:260)
at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:88)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Thread.java:534)
2004-09-27 18:06:54,003 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Error: 1146, SQLState: S1000>
2004-09-27 18:06:54,013 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <General error, message from server: "Table 'k2v01.stb' doesn't exist">
2004-09-27 18:06:54,013 DEBUG [net.sf.hibernate.impl.BatcherImpl] - <done closing: 0 open PreparedStatements, 0 open ResultSets>
2004-09-27 18:06:54,013 DEBUG [net.sf.hibernate.impl.BatcherImpl] - <closing statement>
2004-09-27 18:06:54,023 DEBUG [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Exception>
java.sql.SQLException: General error, message from server: "Table 'k2v01.stb' doesn't exist"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 11:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Yes - that is expected behavior ;)

Think about it...what tablename should we put there ? One class can be spread across multiple places. Thus it just passed the alias on to the sql.

I should probably remove the usage of this in the docs.
hmm - maybe even in H3 throw an exception on it...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 10:41 am 
Newbie

Joined: Mon Sep 27, 2004 6:49 pm
Posts: 3
max wrote:
Yes - that is expected behavior ;)

Think about it...what tablename should we put there ? One class can be spread across multiple places. Thus it just passed the alias on to the sql.

I should probably remove the usage of this in the docs.
hmm - maybe even in H3 throw an exception on it...


So, what is the usage Max? I don't understand. So, it is not actually an alias, I just pass in the actual name of the table? Or do I set up the alias by some call somehow? Why doesn't it use the table name specified in the mapping?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 11:06 am 
Newbie

Joined: Mon Sep 27, 2004 6:49 pm
Posts: 3
Figured it out, no thanks to the documentation. Does every sample have to have the variables, tables, and class all have the exact same name? Impossible to figure out what is implied when all the names are the same.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 28, 2004 11:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
pthornton wrote:
So, what is the usage Max? I don't understand. So, it is not actually an alias, I just pass in the actual name of the table? Or do I set up the alias by some call somehow? Why doesn't it use the table name specified in the mapping?


Because of "One class can be spread across multiple tables".

And as I said, i'll probably remove this "feature" in H3.

The issue is that is just an alias so to be complete you can write:

Code:
select {person.*} from A_PERSON {person}


which will be identical to

Code:
select {person.*} from A_PERSON person


so, it's just a way to use the createSQLQuery alias syntax in the place where you otherwise put in the alias in the sql.

I would appreciate if you would provide input (a patch?) to the docs...

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.