Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Object Relational Mapping and the fly likes Creating a Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Creating a "stored procedure" with HIbernate" Watch "Creating a "stored procedure" with HIbernate" New topic

Creating a "stored procedure" with HIbernate

Alex Bognetz

Joined: Apr 17, 2009
Posts: 2
Hi all

I know that there is a way to call a stored procedure by Hibernate.
Is there a way to create a stored procedure as well?

I need to create a stored procedure dynamically in Pl/PsgSQL and then storing it the db with hibernate.

I have a form with a text area so a user can write pl/PsgSql code inside
When the user submits the form , the code has to be stored as a procedure in the db.
I'd would be great if I could check also the pl/PsgSql syntax, if possible.

Anyone can help me?
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Hibernate supports native queries. Just use them.

As for PL/SQL syntax, Hibernate can't do that. You can either display any SQL error that comes back or you could use something like antlr with a PL/SQL grammar.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: Creating a "stored procedure" with HIbernate
It's not a secret anymore!