Package org.openbravo.service.db
Class CallStoredProcedure
- java.lang.Object
-
- org.openbravo.service.db.CallStoredProcedure
-
public class CallStoredProcedure extends Object
This class is a service class to directly call a stored procedure without using aProcessInstance
.- Author:
- mtaal
-
-
Constructor Summary
Constructors Constructor Description CallStoredProcedure()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
call(String name, List<Object> parameters, List<Class<?>> types)
Object
call(String name, List<Object> parameters, List<Class<?>> types, boolean doFlush)
Object
call(String name, List<Object> parameters, List<Class<?>> types, boolean doFlush, boolean returnResults)
Calls a stored procedure with the specified name.static CallStoredProcedure
getInstance()
static void
setInstance(CallStoredProcedure instance)
-
-
-
Method Detail
-
getInstance
public static CallStoredProcedure getInstance()
-
setInstance
public static void setInstance(CallStoredProcedure instance)
-
call
public Object call(String name, List<Object> parameters, List<Class<?>> types, boolean doFlush)
-
call
public Object call(String name, List<Object> parameters, List<Class<?>> types, boolean doFlush, boolean returnResults)
Calls a stored procedure with the specified name. The parameter list is translated in exactly the same parameters for the call so the parameters should be in the correct order and have the correct type as expected by the stored procedure. The parameter types can be any of the primitive types used by Openbravo (Date, Long, String, etc.).- Parameters:
name
- the name of the stored procedure to call.parameters
- a list of parameters (null values are allowed)types
- the list of types of the parameters, only needs to be set if there are null values and if the null value is something else than a String (which is handled as a default type)doFlush
- do flush before calling stored procedurereturnResults
- whether a fetch for results should be done after the call to the stored procedure (essentially describes whether the PL object is a procedure or function)- Returns:
- the stored procedure result.
-
-