-->
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.  [ 11 posts ] 
Author Message
 Post subject: Does reverse engeneering delete Tables?
PostPosted: Fri Jun 16, 2006 10:53 am 
Regular
Regular

Joined: Mon May 22, 2006 8:32 am
Posts: 67
Hi,

after using reverse engeneering from JDBC connection twice all tables are empty. Does reverse engeneering delete data from used tables?

Urgent! What has happened?

Regards,

a.k.


Top
 Profile  
 
 Post subject: Deleted tables ...
PostPosted: Fri Jun 16, 2006 11:04 am 
Newbie

Joined: Fri Jun 16, 2006 10:48 am
Posts: 3
I also had a table wiped after using "reverse engineering"

Definitely not the behaviour I was expecting ...

If this was intended behaviour at a bare minimum it should give a warning before doing something like dropping a table that has data in it.


Top
 Profile  
 
 Post subject: Re: Deleted tables ...
PostPosted: Fri Jun 16, 2006 11:08 am 
Regular
Regular

Joined: Mon May 22, 2006 8:32 am
Posts: 67
pauldale wrote:
I also had a table wiped after using "reverse engineering"

Definitely not the behaviour I was expecting ...

If this was intended behaviour at a bare minimum it should give a warning before doing something like dropping a table that has data in it.


So it is true!? All data gone by using reverse engeneering. Any more infos about that? If that is what reverse engeneering does Hibernate tools are quite useless...?!

Regards,

a.k.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 16, 2006 11:15 am 
Newbie

Joined: Fri Jun 16, 2006 10:48 am
Posts: 3
Yes, I am sure the hibernate tools wiped a table without telling me that it was going to do so or that it had been done.


Top
 Profile  
 
 Post subject: Deleted tabls
PostPosted: Fri Jun 16, 2006 11:31 am 
Regular
Regular

Joined: Mon May 22, 2006 8:32 am
Posts: 67
Hi,

pauldale wrote:
Yes, I am sure the hibernate tools wiped a table without telling me that it was going to do so or that it had been done.


So the best way to use Htools may be not to use or switch the dbuser before using reverse engeneering...

Thanks for your answers. I am looking forward for more in this discussion.

@max: Can you say anything about that?

Regards,

a.k.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 17, 2006 3:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i guarantee you that we don't delete any tables during reverse engineering.

What you might have done is to enable hbm2ddl.auto to some setting that drop-create tables ? Could that be the case ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 17, 2006 6:13 am 
Regular
Regular

Joined: Mon May 22, 2006 8:32 am
Posts: 67
Hi Max,

max wrote:
i guarantee you that we don't delete any tables during reverse engineering.

What you might have done is to enable hbm2ddl.auto to some setting that drop-create tables ? Could that be the case ?


I don't know where to set this. Can you tell me where to find this "hbm2ddl.auto"? What to do to get rid of this?

Thanks for advice,

regards,

a.k.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 17, 2006 11:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it is normally set in either hibernate.properties or hibernate.cfg.xml

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: hbm2ddl.auto?
PostPosted: Mon Jun 19, 2006 3:22 am 
Newbie

Joined: Fri Jun 16, 2006 10:48 am
Posts: 3
Well, what I can say is that absolutely nothing was touching that tables except for the Hibernate Tools.

I can also say that after using the Hibernate Tools that table no longer had any of its data and had been recreated with only the two columns that were mapped in the .hbm.xml

I can also say that at no point was there any indication in any of the dialogs or labels of fields within the tool that this would be what would happen.

As I posted before, in my opinion dropping an existing table, especially one containing data, without a warning is bad behaviour.

It seems to me that it would be a good idea to add a warning before executing this potentially dangerous operation and better yet to even check if there is data in the table and give a more serious warning.


Top
 Profile  
 
 Post subject: Deleting tables during reverse engeneering
PostPosted: Mon Jun 19, 2006 4:10 am 
Regular
Regular

Joined: Mon May 22, 2006 8:32 am
Posts: 67
Hi,
max wrote:
it is normally set in either hibernate.properties or hibernate.cfg.xml


Yes, i eliminated this. Seems to happen i copied this property from a locale hibernate.cfg.xml to production stage. My fault.

When is this configuration to be executed? During reverse engeneering process? Or just when i open and close the SessionFactory?

Thanks so far!

Regards,

a.k.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 8:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it is executed when you build a sessionfactory (as explained in docs).

Using the tools = using hibernate

I'll see if i can put in a "safety" button.

_________________
Max
Don't forget to rate


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