-->
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: Adminapp - Where in the code does it create the database.
PostPosted: Sun May 23, 2004 2:20 pm 
Newbie

Joined: Sun May 23, 2004 2:03 pm
Posts: 7
I've downloaded and successfully installed the adminapp web application on Tomcat. I particularly like the fact that adminapp automatically creates the database tables for you when running the application.

I would like to adopt the same thing for my own webapplication, and was looking through the adminapp source code to see how it was done. I notice that the database tables aren't created when the application is first loaded, but waits until the first attempt to save a user or role. I also checked in the catalina.log file and could see that hbm2dll and SchemaExport are being called, but I couldn't find any references to them in the source code.

Can some kind soul point me to the code that checks if the database is created and then creates it? Is there some built in configuration setting that activates this functionality?

Any help greatly appreciated,
Scott


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 23, 2004 2:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Hibernate automatically calls SchemaExport if you set hibernate.hbm2ddl.auto in your configuration


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 23, 2004 2:56 pm 
Newbie

Joined: Sun May 23, 2004 2:03 pm
Posts: 7
Thanks for the quick response. I tried setting the property and it worked! Unfortunately the setting seems to want an empty database, as errors are produced if the tables already exist. It also caused some of my dbunit test cases to fail. Oh well, I guess that means it shouldn't be used during development/testing.

/Scott


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.