-->
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.  [ 2 posts ] 
Author Message
 Post subject: could not execute query with MySQL 4.1.11
PostPosted: Mon May 02, 2005 9:33 am 
Newbie

Joined: Mon May 02, 2005 9:22 am
Posts: 2
Hibernate version:3.0.2

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class
name="com.db.hibernate.Site"
table="site"
catalog="client"
>
<id
name="SiteId"
type="java.lang.Integer"
>
<column name="Site_ID" length="10" not-null="true" unique="true" sql-type="int unsigned" />
<generator class="assigned" />
</id>

<property
name="Name"
type="java.lang.String"
>
<column name="Name" length="80" not-null="false" unique="true" sql-type="varchar" />
</property>

<property
name="LastModified"
type="java.util.Date"
>
<column name="LastModified" length="19" not-null="false" sql-type="datetime" />
</property>

<set
name="SetOfStep"
>
<key>
<column name="Site_ID" length="10" not-null="false" />
</key>
<one-to-many
class="com.db.hibernate.Step"
/>
</set>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
List result = session.createQuery(" from Site").list();


Full stack trace of any exception that occurs:

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: select site0_.Site_ID as Site1_, site0_.Name as Name0_, site0_.LastModified as LastModi3_0_ from client__site site0_
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1560)
at org.hibernate.loader.Loader.list(Loader.java:1540)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:791)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.db.SiteManager.listSite(SiteManager.java:64)
at com.eMonitorManager.obtainSite(eMonitorManager.java:52)
at com.eMonitorManager.go(eMonitorManager.java:44)
at com.eMonitorManager.main(eMonitorManager.java:33)
Caused by: java.sql.SQLException: Table 'client.client__site' doesn't exist
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2385)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2306)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1877)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1722)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:118)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1233)
at org.hibernate.loader.Loader.doQuery(Loader.java:370)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
at org.hibernate.loader.Loader.doList(Loader.java:1557)
... 9 more
Exception in thread "main" java.lang.RuntimeException: could not execute query
at com.db.SiteManager.listSite(SiteManager.java:74)
at com.eMonitorManager.obtainSite(eMonitorManager.java:52)
at com.eMonitorManager.go(eMonitorManager.java:44)
at com.eMonitorManager.main(eMonitorManager.java:33)


Name and version of the database you are using: MySQL 4.1.11

The generated SQL (show_sql=true):
Hibernate: select site0_.Site_ID as Site1_, site0_.Name as Name0_, site0_.LastModified as LastModi3_0_ from client__site site0_

Debug level Hibernate log excerpt:
not set.

What can I do ? What else I need to submit ?


Top
 Profile  
 
 Post subject: Problem caused by the catalog tag
PostPosted: Mon May 02, 2005 9:45 am 
Newbie

Joined: Mon May 02, 2005 9:22 am
Posts: 2
Finally I find out why.
It worked after I have removed the catalog tag which is generated by Hibernate Tools.

Should I file a bug report to them ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.