org.eclipse.datatools.connectivity.sqm.loader
Class JDBCRoutineLoader

java.lang.Object
  extended by org.eclipse.datatools.connectivity.sqm.loader.JDBCBaseLoader
      extended by org.eclipse.datatools.connectivity.sqm.loader.JDBCRoutineLoader

public class JDBCRoutineLoader
extends JDBCBaseLoader

Base loader implementation for loading a database's routine (SP, UDF) objects. This class may be specialized as necessary to meet a particular vendor's needs.

Since:
1.0

Nested Class Summary
static interface JDBCRoutineLoader.IRoutineFactory
          Interface for providing creation logic for routines.
static class JDBCRoutineLoader.ProcedureFactory
          Base factory implementation for SP.
static class JDBCRoutineLoader.UserDefinedFunctionFactory
          Base factory implementation for UDF.
 
Field Summary
static java.lang.String COLUMN_PROCEDURE_NAME
          The column name containing the routine's name.
static java.lang.String COLUMN_PROCEDURE_TYPE
          The column name containing the routine's type (SP/UDF).
static java.lang.String COLUMN_REMARKS
          The column name containing the routine's description.
 
Constructor Summary
JDBCRoutineLoader(ICatalogObject catalogObject)
          This constructs the loader using the default ProcedureFactory and UserDefinedFunctionFactory and uses the ConnectionFilter.STORED_PROCEDURE_FILTER filter.
JDBCRoutineLoader(ICatalogObject catalogObject, IConnectionFilterProvider connectionFilterProvider)
          This constructs the loader using the default ProcedureFactory and UserDefinedFunctionFactory.
JDBCRoutineLoader(ICatalogObject catalogObject, IConnectionFilterProvider connectionFilterProvider, JDBCRoutineLoader.IRoutineFactory udfFactory, JDBCRoutineLoader.IRoutineFactory spFactory)
           
 
Method Summary
 void clearRoutines(java.util.List routines)
          Removes the specified routines from the model.
 JDBCRoutineLoader.IRoutineFactory getProcedureFactory()
           
 JDBCRoutineLoader.IRoutineFactory getUserDefinedFunctionFactory()
          Sets the UDF factory used by this object
 java.util.List loadRoutines()
          Deprecated. see loadRoutines(List, Collection)
 void loadRoutines(java.util.List containmentList, java.util.Collection existingRoutines)
          Loads the "routine" objects from the database.
 void setProcedureFactory(JDBCRoutineLoader.IRoutineFactory procedureFactory)
          Sets the procedure factory used by this object
 void setUserDefinedFunctionFactory(JDBCRoutineLoader.IRoutineFactory userDefinedFunctionFactory)
           
 
Methods inherited from class org.eclipse.datatools.connectivity.sqm.loader.JDBCBaseLoader
getCatalogObject, setCatalogObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLUMN_PROCEDURE_NAME

public static final java.lang.String COLUMN_PROCEDURE_NAME
The column name containing the routine's name.

See Also:
java.sql.DatabaseMetaData.getProcedures(), Constant Field Values

COLUMN_REMARKS

public static final java.lang.String COLUMN_REMARKS
The column name containing the routine's description.

See Also:
java.sql.DatabaseMetaData.getProcedures(), Constant Field Values

COLUMN_PROCEDURE_TYPE

public static final java.lang.String COLUMN_PROCEDURE_TYPE
The column name containing the routine's type (SP/UDF).

See Also:
java.sql.DatabaseMetaData.getProcedures(), Constant Field Values
Constructor Detail

JDBCRoutineLoader

public JDBCRoutineLoader(ICatalogObject catalogObject)
This constructs the loader using the default ProcedureFactory and UserDefinedFunctionFactory and uses the ConnectionFilter.STORED_PROCEDURE_FILTER filter.

Parameters:
catalogObject - the Schema object upon which this loader operates.

JDBCRoutineLoader

public JDBCRoutineLoader(ICatalogObject catalogObject,
                         IConnectionFilterProvider connectionFilterProvider)
This constructs the loader using the default ProcedureFactory and UserDefinedFunctionFactory.

Parameters:
catalogObject - the Schema object upon which this loader operates.
connectionFilterProvider - the filter provider used for filtering the "routine" objects being loaded

JDBCRoutineLoader

public JDBCRoutineLoader(ICatalogObject catalogObject,
                         IConnectionFilterProvider connectionFilterProvider,
                         JDBCRoutineLoader.IRoutineFactory udfFactory,
                         JDBCRoutineLoader.IRoutineFactory spFactory)
Parameters:
catalogObject - the Schema object upon which this loader operates.
connectionFilterProvider - the filter provider used for filtering the "routine" objects being loaded
udfFactory - factory for creating UDF objects
spFactory - factory for creating SP objects
Method Detail

loadRoutines

public java.util.List loadRoutines()
                            throws java.sql.SQLException
Deprecated. see loadRoutines(List, Collection)

Returns:
a collection of Routine objects
Throws:
java.sql.SQLException - if an error occurred during loading.

loadRoutines

public void loadRoutines(java.util.List containmentList,
                         java.util.Collection existingRoutines)
                  throws java.sql.SQLException
Loads the "routine" objects from the database. This method uses the result set from createResultSet() to load the "routine" objects from the server. This method first checks the name of the "routine" to determine whether or not it should be filtered. If it is not filtered, it checks to see if an object with that name was loaded previously. If it finds an existing object, it refreshes that object and adds it to the containment list. If the named object does not exist, the result set is passed processRow(). Routine objects are created and initialized using one of the registered factories. This method should only be overridden as a last resort when the desired behavior cannot be acheived by overriding createResultSet(), closeResultSet(), processRow(), and a specialized SP and UDF factories.

Parameters:
containmentList - the containment list held by parent
existingRoutines - the catalog objects which were previously loaded
Throws:
java.sql.SQLException - if an error occurred during loading.

clearRoutines

public void clearRoutines(java.util.List routines)
Removes the specified routines from the model.

Parameters:
routines - the routines to be removed from the model.

getProcedureFactory

public JDBCRoutineLoader.IRoutineFactory getProcedureFactory()
Returns:
the procedure factory used by this object

setProcedureFactory

public void setProcedureFactory(JDBCRoutineLoader.IRoutineFactory procedureFactory)
Sets the procedure factory used by this object


getUserDefinedFunctionFactory

public JDBCRoutineLoader.IRoutineFactory getUserDefinedFunctionFactory()
Sets the UDF factory used by this object


setUserDefinedFunctionFactory

public void setUserDefinedFunctionFactory(JDBCRoutineLoader.IRoutineFactory userDefinedFunctionFactory)


Copyright © 2006 -- 2008 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.