[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Stored procedure calls made easy

wkudla do-not-reply at jboss.com
Thu Jun 26 14:37:26 EDT 2008


Since there is a lot of stored procedure invocations in my current project (on Oracle db) I decided to isolate a dedicated component for completing this task.
The project is called JProcedure and being hosted on google code at the moment: http://jprocedure.googlecode.com.
There is some wiki documentation showing how to use the stuff.
The basic concept for this project was to simplify stored procedure invocations from java code (which can be a pain in the *** sometimes) by leveraging java annotations.
The only thing you have to do is annotate a class that represents stored procedure definition and then annotate any method that reflects a stored procedure. For transforming the statement output you will have to write your custom ResultTransformer and that's it.
The engine supports automated caching (which you can turn on and off using annotations) and custom invocation interceptors that allow you to add additional logic before and after a stored procedure call.
Current limitations:
1. There is only Oracle support implemented at the moment, but supporting other db vendors is just a matter of implementing a single StatementBuilder interface.
2. The Connection object is being obtained from JNDI given a DataSource path and does not support caching Datasource object - this will be enchanced to support different ways of obtaining a connection
3. There is no specific exception handling policy (on to do list)
4. No transaction management which means you have to use the component in transactional context or manage transaction yourself  (To be done)

The engine works and occured to be extremely handy, hence the decision of open-sourcing it.

If you find few spare minutes and take a look at what has been done so far, I will very much appreciate any positive and negative feedback.

Once again: http://jprocedure.googlecode.com/

Thanks in advance

Wojciech Kudla 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4160961#4160961

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4160961

More information about the jboss-user mailing list