-->
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.  [ 6 posts ] 
Author Message
 Post subject: Problem mit hibernate.cfg.xml + introduction to hibernate.
PostPosted: Tue Sep 06, 2005 3:02 pm 
Newbie

Joined: Tue Sep 06, 2005 2:45 pm
Posts: 3
Wie man gleich merken wird bin ich recht neu in Hibernate

Ich bin im Tutorial nun so weit gekommen, dass ich folgende zeile entfernen soll.

<property name="hbm2ddl.auto">create</property>

Wenn ich dies jedoch tue erhalte ich beim ausführen von "ant run -Daction=store" folgenden Fehler:

[java] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not fetch initial value
[java] at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
[java] at org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:107)
[java] at org.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:45)
[java] at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:85)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
[java] at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
[java] at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
[java] at org.hibernate.impl.SessionImpl.save(SessionImpl.java:481)
[java] at org.hibernate.impl.SessionImpl.save(SessionImpl.java:476)
[java] at EventManager.createAndStoreEvent(Unknown Source)
[java] at EventManager.main(Unknown Source)
[java] Caused by: java.sql.SQLException: Table not found in statement [select max(EVENT_ID) from EVENTS]
[java] at org.hsqldb.jdbc.Util.throwError(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
[java] at org.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:86)
[java] ... 11 more
[java] Java Result: 1

Wenn die Zeile in der Konfiguration vorhanden ist
kann mir da jemand vielleicht einen Tip geben?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 3:05 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Ich geb' jetzt endgueltig auf und werfe den ganzen Abschnitt aus dem Tutorial. Anscheinend versteht keiner was hbm2ddl macht.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 3:07 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Hast Du das 3.1 beta 2 tutorial genommen oder das 3.0.5?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 3:17 pm 
Newbie

Joined: Tue Sep 06, 2005 2:45 pm
Posts: 3
sorry für die dumme frage.

Das 3.05 Tutorial, das beim Download dabei war.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 3:20 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Schau mal ob du den gleichen Abschnitt in 3.1 beta 2 besser verstehst. Inhaltlich hat sich am Tutorial sonst nichts geaendert, auch der Text ist einfach nur eine andere Erklaerung.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 3:22 pm 
Newbie

Joined: Tue Sep 06, 2005 2:45 pm
Posts: 3
ok, danke!


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