-->
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.  [ 2 posts ] 
Author Message
 Post subject: how to initialize schema in dynamic web project in eclipse
PostPosted: Wed Oct 01, 2008 2:30 pm 
Newbie

Joined: Fri Sep 19, 2008 2:49 am
Posts: 1
HI

I'm using the hibernate annotation. I've got all my entities ready. but I used a main function which contains configuration rather than that hibernate.cfg.xml... I'd like to know how to make it automatically do the initialisation when I run the project on tomcat server??? I'm new to hibernate and I dont know too much with this.


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2008 3:47 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

when working in a webapp you usually bootstrap Hibernate from a Servlet or Filter. You can write your own, but depending on which framework you are using a Hibernate integration might be already included. Spring eg offers a OpenEntityManagerInViewFilter or OpenSessionInViewFilter
to boostrap Hibernate. This filters also ensure that a Hibernate session exists while a request gets served. Have a read about the Open Session in View pattern: http://hibernate.org/43.html.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.