-->
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.  [ 1 post ] 
Author Message
 Post subject: Table 'maringasaude.hibernate_unique_key' doesn't exist
PostPosted: Fri Jul 15, 2005 2:39 pm 
Newbie

Joined: Tue Jul 12, 2005 2:46 pm
Posts: 13
Location: BS2
which the error?
I am not understanding, nothing.
I do not know which the problem.




Hibernate 2.1:

Mapping documents:
<hibernate-mapping>
<class name="dados.entity.Noticia" table="noticia">
<id name="id_noticia" column="id_noticia" type="int" unsaved-value="-1">
<generator class="native" />
</id>

<property name="titulo" column="titulo" type="string"/>
<property name="chamada" column="chamada" type="string"/>
<property name="link_da_noticia" column="link_da_noticia" type="string"/>
</class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
try {
for(Iterator i=items.iterator(); i.hasNext(); ) {
ItemIF item = ( ItemIF )i.next();
Noticia noticia = new Noticia(item.getDescription(), item.getTitle(), item.getLink().toString());

Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();
session.save(noticia);
tx.commit();
HibernateUtil.closeSession();
}

} catch (Exception e){
e.printStackTrace();
}

Full stack trace of any exception that occurs:
WARNING: SQL Error: 1146, SQLState: 42S02
15/07/2005 15:37:20 net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Table 'maringasaude.hibernate_unique_key' doesn't exist
net.sf.hibernate.exception.SQLGrammarException: Could not save object
at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:58)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4131)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:794)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:749)
at dados.FolhaOnLineInforma.Cadastrar.processar(Cadastrar.java:35)
at dados.FolhaOnLineInforma.Folha.cadastrar(Folha.java:24)
at folhaonlinersscadastrator.Main.main(Main.java:12)
Caused by: java.sql.SQLException: Table 'maringasaude.hibernate_unique_key' doesn't exist
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1534)
at com.mysql.jdbc.ServerPreparedStatement.serverPrepare(ServerPreparedStatement.java:1485)
at com.mysql.jdbc.ServerPreparedStatement.<init>(ServerPreparedStatement.java:151)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1309)
at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1281)
at net.sf.hibernate.id.TableGenerator.generate(TableGenerator.java:92)
at net.sf.hibernate.id.TableHiLoGenerator.generate(TableHiLoGenerator.java:59)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:776)
... 4 more

Name and version of the database you are using:
MySQL 4.1.12a-nt-max

Debug level Hibernate log excerpt:


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

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.