-->
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.  [ 3 posts ] 
Author Message
 Post subject: Table does not exist
PostPosted: Wed Aug 24, 2005 4:40 pm 
Newbie

Joined: Mon Jun 13, 2005 2:39 pm
Posts: 7
Hi. I've been trying to excute the simplest query. I'm getting SQLException indicating not being able to find the table. I do have a table but it just doesn't see it. Any tips or suggestions would be appreciate it.

Hibernate version: 3.0

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.adsmack.smacklet.horoscope.domain.DailyHoroscope" table="dailyhoroscope" catalog="">
<id name="id" type="integer">
<column name="ID" />
<generator class="assigned" />
</id>
<many-to-one name="zodiacsigns" class="com.adsmack.smacklet.horoscope.domain.ZodiacSigns">
<column name="SignID" not-null="true" unique="true" />
</many-to-one>
<property name="date" type="timestamp">
<column name="Date" length="19" not-null="true" />
</property>
<property name="horoscope" type="string">
<column name="Horoscope" length="16277215" />
</property>
<property name="luckyNumbers" type="string">
<column name="LuckyNumbers" length="25" />
</property>

</class>
</hibernate-mapping>


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

Session s = factory.openSession();
Transaction tx = s.beginTransaction();
List result = s.createQuery("from DailyHoroscope").list();
s.flush();
tx.commit();

Exception that occurs:

java.sql.SQLException: Table 'horoscope_smacklet.__dailyhoroscope' doesn't exist

Name of the database: MySQL


Top
 Profile  
 
 Post subject: Re: Table does not exist
PostPosted: Wed Aug 24, 2005 4:48 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
try removing the catalog=""

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject: Re: Table does not exist
PostPosted: Thu Aug 25, 2005 7:39 am 
Newbie

Joined: Mon Jun 13, 2005 2:39 pm
Posts: 7
pksiv wrote:
try removing the catalog=""


That's exactly what I had to do. Thank you very much!


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