-->
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: How to Create stored procedures/triggers automatically?
PostPosted: Wed Dec 30, 2009 9:33 am 
Newbie

Joined: Wed Dec 30, 2009 9:26 am
Posts: 2
Hello,
We have been using Hibernate/JPA/Spring based configuration for the project and for the development phase we are using "<property name="hibernate.hbm2ddl.auto" value="create-drop" /> ". Hibernate takes care of creating tables and db using entities based annotation when the application server starts/restarts.

We have been using some Stored procedures and triggers as well, but each time db is dropped they have to be created manually, though tables are getting created automatically.

Can someone point a direction so that may be we can execute a .sql file containing creation of trigger/SP SQL statements and it get executed on server startup automatically?

thanks a ton.


Top
 Profile  
 
 Post subject: Re: How to Create stored procedures/triggers automatically?
PostPosted: Wed Jan 06, 2010 10:16 pm 
Newbie

Joined: Wed Jan 06, 2010 2:30 am
Posts: 5
By using Hibernate, you can't create stored procedures or trigger automatically, I tried before but it doesn't work

_________________
Hibernate guides developer for marketing, It's powerful.


Top
 Profile  
 
 Post subject: Re: How to Create stored procedures/triggers automatically?
PostPosted: Thu Jan 07, 2010 1:10 am 
Newbie

Joined: Wed Dec 30, 2009 9:26 am
Posts: 2
rekk1986 wrote:
By using Hibernate, you can't create stored procedures or trigger automatically, I tried before but it doesn't work


Yes......so for time being, I created my own dispatcher servlet in spring, created a dao with method to execute scripts from my project folder, on startup of application server, spring executes dispatcher servlet and hence my .sql file gets processed and job is done. still waiting for other idea/solution....


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.