Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] StoredFunctionCall with ROWTYPE as returnvalue

Support for this was added in the EclipseLink 1.1 release.

See, PLSQLStoredProcedureCall in the
org.eclipse.persistence.platform.database.oracle.plsql package.


Martin.Berner wrote:
> 
> Hello,
> we have a lot of StoredProcedures and StoredFunctions on the underlying 
> Oracle 10g Database written in PL/SQL. I managed to access a Function 
> returning a single Value of a JDBC normal Type for example by using this 
> wrapperfunction:
>     public <T> T executeFunction(String functionName, HashMap<String, 
> Object> params, Class<T> returnValueClass) {
>         StoredFunctionCall functionCall = new StoredFunctionCall();
>         functionCall.setProcedureName(functionName);
>         ValueReadQuery query = new ValueReadQuery();
>         query.setCall(functionCall);
>         List args = new ArrayList();
>         for (String key : params.keySet()) {
>             functionCall.addNamedArgument(key);
>             query.addArgument(key);
>             args.add(params.get(key));
>         }
>        functionCall.setResult("FUNCTION_RESULT", returnValueClass);
>        return (T) getSession().executeQuery(query, args);
>     }
> 
> 
> But some of our Function return a row of a Table. For example:
> FUNCTION rowGetZwParameter(pnParID IN NUMBER) RETURN
> T_ZWPARAMETER%ROWTYPE;
> 
> How do I access such a Function?
> 
> I'm very kind of any help.
> Berner Martin
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/StoredFunctionCall-with-ROWTYPE-as-returnvalue-tp23368567p23373257.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top