-->
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/view already exists
PostPosted: Sun Mar 20, 2011 8:05 am 
Beginner
Beginner

Joined: Mon Nov 15, 2010 10:39 am
Posts: 27
Hi,

I have a quite strange problem. I have a pretty large set of tables, linked together with bidirectional one-to-many/many-to-one associations.

The problem occurs when i try to run my application. I get an error message saying that one of my tables already exist. But, when i remove the mapping for this class, i get an error message that this class is not mapped. I really don't get this, as the table is mapped only one place. Could there be that a class could be mapped through an association or something like that?

- Tobb


Top
 Profile  
 
 Post subject: Re: Table/view already exists
PostPosted: Mon Mar 21, 2011 4:04 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
saying that one of my tables already exist


Seems like your application is trying to create the table again.
So if there are unwanted DDL-statements (Data Definition Language) such as 'create table' statements
when you start the application, I guess that you forgot to remove the hbm2ddl.auto property in your persistence.xml file
Code:
<property name="hibernate.hbm2ddl.auto" value="create"></property>


Top
 Profile  
 
 Post subject: Re: Table/view already exists
PostPosted: Mon Mar 21, 2011 7:43 am 
Beginner
Beginner

Joined: Mon Nov 15, 2010 10:39 am
Posts: 27
Fixed it, was a bug in the underlying database. I am using create-drop for developing, but one of the tables appearantly wasn't properly dropped. Just renamed the database to start fresh and it worked again..


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.