-->
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: Autogenerating db schema
PostPosted: Sun Nov 07, 2004 7:13 am 
Newbie

Joined: Sun Nov 07, 2004 7:03 am
Posts: 8
I want an application to initialize database automaticly, if there're no proper relations yet. I use SchemaExport class. The problem is i don't know how to check if schema was exported already. I use work-around:

1. The user specifies DB url
2. Application connects to DB (creates session)
1. Application tries to find any object of specified type first
2. If HibernateException occurs, I assume schema wasn't exported yet, and I perform SchemaExport.

It works fine but it's like scrathing oneself in the left ear using right foot.
Anybody has an idea how to check if relation in database exist?

Thnx in advance.


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.