Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Hibernate hbm2ddl problem?
PostPosted: Fri Nov 21, 2008 3:46 pm 
Newbie

Joined: Fri Nov 21, 2008 3:35 pm
Posts: 12
2008-11-21 11:31:00,003 [main] INFO org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
2008-11-21 11:31:00,003 [main] INFO org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
2008-11-21 11:31:00,007 [main] INFO org.hibernate.tool.hbm2ddl.SchemaUpdate - updating schema
2008-11-21 11:31:00,021 [main] INFO org.hibernate.tool.hbm2ddl.DatabaseMetadata - table not found: user_messages
2008-11-21 11:31:00,023 [main] INFO org.hibernate.tool.hbm2ddl.DatabaseMetadata - table not found: user_messages
2008-11-21 11:31:00,057 [main] INFO org.hibernate.tool.hbm2ddl.SchemaUpdate - schema update complete

That is what I see when I try running my Spring application. I have other entities that are binding just fine. I'm using the Spring AnnotationSessionFactoryBean.

What's happening is it is completely not writing the entity to the database, though it does write all of the other entities just fine. What can I do to correct this?

I tried setting hbm2ddl.auto = create, but that didn't do anything except drop 250 hand entered records... luckily I have a backup. What should I do?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2008 6:14 pm 
Beginner
Beginner

Joined: Mon Jul 07, 2008 8:07 pm
Posts: 42
So no table is getting generated?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2008 5:54 am 
Newbie

Joined: Wed Oct 08, 2008 1:54 am
Posts: 14
The debug output would be interesting - normally there is also an error message for each failed alter/create statement ...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 22, 2008 7:47 am 
Newbie

Joined: Sun Nov 16, 2008 8:28 pm
Posts: 14
Location: Hamburg
<hbm2ddl export="true" drop="true" create="true" update="true" outputfilename="${schema.name}.sql"/>

Set the create parameter to true and maybe your problem is solved.

Regards,
Nepumuk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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.