org.brains2b.sql.meta
Class ProcedureModel

java.lang.Object
  extended by org.brains2b.sql.meta.ProcedureModel
All Implemented Interfaces:
SQLMetaModel

public class ProcedureModel
extends java.lang.Object
implements SQLMetaModel

Wrapper around a procedure definition from DatabaseMetaData

Class is read-only, use SquelerDDL:ProcedureDDL for changing columns

Version:
1.01 [26-10-2007]
Author:
dennis@brains2b.nl
See Also:
SQLMetaData, SQLRecord

Field Summary
static java.lang.String FUNCTION
          constant for a model defined as function
static java.lang.String PACKAGE
          constant for a model defined as package
static java.lang.String PACKAGE_BODY
          constant for a model defined as package body
static java.lang.String PROCEDURE
          constant for a model defined as procedure
 
Constructor Summary
protected ProcedureModel()
          Constructor only used by ProcedureDDL
  ProcedureModel(SQLRecord record)
          Create a ProcedureModel on the basis of this SQLRecord
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getCatalog()
          get the Catalog for this ProcedureModel
 java.lang.String getName()
          get the name for this model's instance
 java.util.List getParameters()
          get the parameters for this ProcedureModel
 SQLRecord getRecord()
          the record which defines all the values for the model
 ParameterModel getReturnValue()
          get the return value for this ProcedureModel
 java.lang.String getSchema()
          get the Schema for this ProcedureModel
 java.lang.String getType()
          get the type of Object defined by the meta model
protected  void setParameters(java.util.List list)
          set the parameters for this ProcedureModel
protected  void setReturnValue(ParameterModel model)
          set the return value for this ProcedureModel
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROCEDURE

public static final java.lang.String PROCEDURE
constant for a model defined as procedure

See Also:
Constant Field Values

FUNCTION

public static final java.lang.String FUNCTION
constant for a model defined as function

See Also:
Constant Field Values

PACKAGE

public static final java.lang.String PACKAGE
constant for a model defined as package

See Also:
Constant Field Values

PACKAGE_BODY

public static final java.lang.String PACKAGE_BODY
constant for a model defined as package body

See Also:
Constant Field Values
Constructor Detail

ProcedureModel

protected ProcedureModel()
Constructor only used by ProcedureDDL


ProcedureModel

public ProcedureModel(SQLRecord record)
Create a ProcedureModel on the basis of this SQLRecord

If the PROCEDURE_TYPE of this SQLRecord equals DatabaseMetaData.procedureReturnsResult type is set to FUNCTION

Parameters:
record - SQLRecord, the record containing the information on this column
Method Detail

getName

public java.lang.String getName()
get the name for this model's instance

This is equal to the name of the table,column, etc.

Specified by:
getName in interface SQLMetaModel
Returns:
String

getRecord

public SQLRecord getRecord()
the record which defines all the values for the model

Specified by:
getRecord in interface SQLMetaModel
Returns:
SQLRecord

getType

public java.lang.String getType()
get the type of Object defined by the meta model

returned value depends on the model: TABLE,COLUMN,INDEX

Specified by:
getType in interface SQLMetaModel
Returns:
String

getParameters

public java.util.List getParameters()
get the parameters for this ProcedureModel

Returns:
List of ParameterModel

setParameters

protected void setParameters(java.util.List list)
set the parameters for this ProcedureModel

Parameters:
list - List of ParameterModel

getReturnValue

public ParameterModel getReturnValue()
get the return value for this ProcedureModel

Returns:
ParameterModel, null if this ProcedureModel is not a function

setReturnValue

protected void setReturnValue(ParameterModel model)
set the return value for this ProcedureModel

Parameters:
model - ParameterModel

getCatalog

public java.lang.String getCatalog()
get the Catalog for this ProcedureModel

Returns:
String, null if this procedure does not have a catalog

getSchema

public java.lang.String getSchema()
get the Schema for this ProcedureModel

Returns:
String, null if this procedure does not have a schema

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object