wood burning stoves*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Creating a "stored procedure" with HIbernate" Watch "Creating a "stored procedure" with HIbernate" New topic
Author

Creating a "stored procedure" with HIbernate

Alex Bognetz
Greenhorn

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.

Example:
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
Bartender

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
 
Don't get me started about those stupid light bulbs.
 
subject: Creating a "stored procedure" with HIbernate
 
Similar Threads
SQL
Stored Procedure + Hibernate + DB2
Pass ArrayList To Oracle
Difference Between Named Queries and Stored Procedures
writing log to a file from java stored procedure