Package org.apache.cayenne.map
Class Procedure
java.lang.Object
org.apache.cayenne.map.Procedure
- All Implemented Interfaces:
Serializable
,ConfigurationNode
,CayenneMapEntry
,XMLSerializable
public class Procedure
extends Object
implements ConfigurationNode, CayenneMapEntry, XMLSerializable, Serializable
A mapping descriptor for a database stored procedure.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
acceptVisitor
(ConfigurationNodeVisitor<T> visitor) void
Adds new call parameter to the stored procedure.void
void
encodeAsXML
(XMLEncoder encoder, ConfigurationNodeVisitor delegate) Prints itself as XML to the provided XMLEncoder.static String
generateFullyQualifiedName
(String catalog, String schema, String name) Utility function to generate fully qualified name for procedureReturns a list of OUT and INOUT call parameters.Returns an unmodifiable list of call parameters.Returns procedure name including schema and catalog, if present.getName()
Returns the name property of this object.Returns the parent map.Returns parameter describing the return value of the StoredProcedure, or null if procedure does not support return values.boolean
Returnstrue
if a stored procedure returns a value.void
removeCallParameter
(String name) Removes a named call parameter.void
setCallParameters
(List<ProcedureParameter> parameters) void
setCatalog
(String string) Sets stored procedure's catalog.void
setDataMap
(DataMap dataMap) Sets parent DataMap of this entity.void
void
Stores the parent map.void
setReturningValue
(boolean returningValue) void
Sets stored procedure's database schema.
-
Field Details
-
name
-
dataMap
-
catalog
-
schema
-
returningValue
protected boolean returningValue -
callParameters
-
-
Constructor Details
-
Procedure
public Procedure()Creates an unnamed procedure object. -
Procedure
Creates a named Procedure object.
-
-
Method Details
-
acceptVisitor
- Specified by:
acceptVisitor
in interfaceConfigurationNode
- Since:
- 3.1
-
getName
Description copied from interface:CayenneMapEntry
Returns the name property of this object.- Specified by:
getName
in interfaceCayenneMapEntry
- Returns:
- name of this entry.
-
setName
-
getParent
Description copied from interface:CayenneMapEntry
Returns the parent map.- Specified by:
getParent
in interfaceCayenneMapEntry
-
setParent
Description copied from interface:CayenneMapEntry
Stores the parent map.- Specified by:
setParent
in interfaceCayenneMapEntry
-
encodeAsXML
Prints itself as XML to the provided XMLEncoder.- Specified by:
encodeAsXML
in interfaceXMLSerializable
- Since:
- 1.1
-
getFullyQualifiedName
Returns procedure name including schema and catalog, if present. -
generateFullyQualifiedName
Utility function to generate fully qualified name for procedure -
getDataMap
- Returns:
- parent DataMap of this entity.
-
setDataMap
Sets parent DataMap of this entity. -
setCallParameters
-
addCallParameter
Adds new call parameter to the stored procedure. Also setsparam
's parent to be this procedure. -
removeCallParameter
Removes a named call parameter. -
clearCallParameters
public void clearCallParameters() -
getCallParameters
Returns an unmodifiable list of call parameters. -
getCallOutParameters
Returns a list of OUT and INOUT call parameters. If procedure has a return value, it will also be included as a call parameter. -
getResultParam
Returns parameter describing the return value of the StoredProcedure, or null if procedure does not support return values. If procedure supports return parameters, its first parameter is always assumed to be a return result. -
isReturningValue
public boolean isReturningValue()Returnstrue
if a stored procedure returns a value. The first parameter in a list of parameters will be assumed to be a descriptor of return value.- Returns:
- boolean
-
setReturningValue
public void setReturningValue(boolean returningValue) -
getCatalog
-
getSchema
-
setCatalog
Sets stored procedure's catalog. -
setSchema
Sets stored procedure's database schema.
-