Description: This Class was designed to read in a project and produce StoredProcedures. It then modifies the descriptors files of the project to use these StoredProcedures.
Note
reads are not supported in Oracle.
Responsibilities:
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private Hashtable | |
| private Hashtable | mappingStoredProcedures
This hashtable is used to store the storedProcedure referenced by the mapping name. |
| private static final int | |
| private String | |
| public SchemaManager | |
| private Hashtable | |
| private Hashtable | storedProcedures
This hashtable is used to store the storedProcedure referenced by the class name. |
| private Writer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected String | buildProcedureString(SQLCall call)
INTERNAL: Given a call, this method produces the stored procedure string based on the SQL string inside the call. |
| public void | generateAmendmentClass(Writer outputWriter, String packageName, String className)
PUBLIC: Generate an amendment class that will set up the descriptors to use these stored procedures. |
| protected StoredProcedureDefinition | generateDeleteStoredProcedure(ClassDescriptor descriptor)
INTERNAL: Generates the delete stored procedure for this descriptor |
| protected StoredProcedureDefinition | generateInsertStoredProcedure(ClassDescriptor descriptor)
INTERNAL: Generates the insert stored procedure for this descriptor |
| protected Hashtable | generateMappingStoredProcedures(ClassDescriptor descriptor)
INTERNAL: Generates the mapping stored procedures for this descriptor. |
| protected StoredProcedureDefinition | generateObjectStoredProcedure(DatabaseQuery query, List<DatabaseField> fields, String namePrefix)
INTERNAL: Generates the object level stored procedure based on the passed in query |
| protected StoredProcedureDefinition | generateOneToManyMappingDeleteAllProcedure(OneToManyMapping mapping)
INTERNAL: Generates the delete all stored procedure for this mapping |
| protected StoredProcedureDefinition | generateOneToManyMappingProcedures(OneToManyMapping mapping, DatabaseQuery query, Map<DatabaseField, DatabaseField> fields, String namePrefix)
INTERNAL: Generates all the stored procedures for this mapping |
| protected StoredProcedureDefinition | generateOneToManyMappingReadProcedure(OneToManyMapping mapping)
INTERNAL: Generates the read all stored procedure for this mapping |
| protected StoredProcedureDefinition | generateReadAllStoredProcedure(ClassDescriptor descriptor)
INTERNAL: Generates the read all stored procedure for this descriptor |
| protected StoredProcedureDefinition | generateReadStoredProcedure(ClassDescriptor descriptor)
INTERNAL: Generates the read stored procedure for this descriptor |
| protected void | generateSequenceStoredProcedures(Project project)
INTERNAL: Generates the select and update stored procedures for this project. |
| protected StoredProcedureDefinition | generateStoredProcedure(DatabaseQuery query, List<DatabaseField> fields, String name)
INTERNAL: Generates the stored procedure for this query. |
| protected StoredProcedureDefinition | generateStoredProcedure(DatabaseQuery query, List<DatabaseField> fields, AbstractRecord rowForPrepare, String name)
INTERNAL: Generates the stored procedure for this query using the row passed in for the check prepare. |
| public void | |
| public void | generateStoredProcedures(Writer writerOrNull)
PUBLIC: generates all the stored procedures to the writer using the schema manager outputDDLToWriter(Writer). |
| protected StoredProcedureDefinition | generateUpdateStoredProcedure(ClassDescriptor descriptor)
INTERNAL: Generates the update stored procedure for this descriptor |
| protected String | getFieldName(String argumentName)
INTERNAL: return the original field name based on the argument name. |
| protected Class | getFieldType(Object jdbcDataType)
INTERNAL: return the class corresponding to the passed in JDBC type. |
| public String | |
| public AbstractSession | |
| public Writer | |
| public void | |
| protected void | |
| public void |
| DEFAULT_PREFIX | back to summary |
|---|---|
| private static final String DEFAULT_PREFIX | |
| intToTypeConverterHash | back to summary |
|---|---|
| private Hashtable<Integer, Class<?>> intToTypeConverterHash | |
| mappingStoredProcedures | back to summary |
|---|---|
| private Hashtable<ClassDescriptor, Hashtable<String, Hashtable<String, StoredProcedureDefinition>>> mappingStoredProcedures This hashtable is used to store the storedProcedure referenced by the mapping name. | |
| MAX_NAME_SIZE | back to summary |
|---|---|
| private static final int MAX_NAME_SIZE | |
| prefix | back to summary |
|---|---|
| private String prefix | |
| schemaManager | back to summary |
|---|---|
| public SchemaManager schemaManager | |
| sequenceProcedures | back to summary |
|---|---|
| private Hashtable<String, StoredProcedureDefinition> sequenceProcedures | |
| storedProcedures | back to summary |
|---|---|
| private Hashtable<ClassDescriptor, Vector<StoredProcedureDefinition>> storedProcedures This hashtable is used to store the storedProcedure referenced by the class name. | |
| writer | back to summary |
|---|---|
| private Writer writer | |
| StoredProcedureGenerator | back to summary |
|---|---|
| public StoredProcedureGenerator(SchemaManager schemaMngr) | |
| buildIntToTypeConverterHash | back to summary |
|---|---|
| protected void buildIntToTypeConverterHash() INTERNAL: Build all conversions based on JDBC return values. | |
| buildProcedureString | back to summary |
|---|---|
| protected String buildProcedureString(SQLCall call) INTERNAL: Given a call, this method produces the stored procedure string based on the SQL string inside the call. | |
| generateAmendmentClass | back to summary |
|---|---|
| public void generateAmendmentClass(Writer outputWriter, String packageName, String className) throws ValidationException PUBLIC: Generate an amendment class that will set up the descriptors to use these stored procedures. | |
| generateDeleteStoredProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateDeleteStoredProcedure(ClassDescriptor descriptor) INTERNAL: Generates the delete stored procedure for this descriptor | |
| generateInsertStoredProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateInsertStoredProcedure(ClassDescriptor descriptor) INTERNAL: Generates the insert stored procedure for this descriptor | |
| generateMappingStoredProcedures | back to summary |
|---|---|
| protected Hashtable INTERNAL: Generates the mapping stored procedures for this descriptor. currently only 1:1 and 1:M are supported | |
| generateObjectStoredProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateObjectStoredProcedure(DatabaseQuery query, List<DatabaseField> fields, String namePrefix) INTERNAL: Generates the object level stored procedure based on the passed in query | |
| generateOneToManyMappingDeleteAllProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateOneToManyMappingDeleteAllProcedure(OneToManyMapping mapping) INTERNAL: Generates the delete all stored procedure for this mapping | |
| generateOneToManyMappingProcedures | back to summary |
|---|---|
| protected StoredProcedureDefinition generateOneToManyMappingProcedures(OneToManyMapping mapping, DatabaseQuery query, Map<DatabaseField, DatabaseField> fields, String namePrefix) INTERNAL: Generates all the stored procedures for this mapping | |
| generateOneToManyMappingReadProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateOneToManyMappingReadProcedure(OneToManyMapping mapping) INTERNAL: Generates the read all stored procedure for this mapping | |
| generateReadAllStoredProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateReadAllStoredProcedure(ClassDescriptor descriptor) INTERNAL: Generates the read all stored procedure for this descriptor | |
| generateReadStoredProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateReadStoredProcedure(ClassDescriptor descriptor) INTERNAL: Generates the read stored procedure for this descriptor | |
| generateSequenceStoredProcedures | back to summary |
|---|---|
| protected void generateSequenceStoredProcedures(Project project) INTERNAL: Generates the select and update stored procedures for this project. no procedures are generated for native sequencing. Note reads are not supported in Oracle. | |
| generateStoredProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateStoredProcedure(DatabaseQuery query, List<DatabaseField> fields, String name) INTERNAL: Generates the stored procedure for this query. A new row will be used for the check prepare. | |
| generateStoredProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateStoredProcedure(DatabaseQuery query, List<DatabaseField> fields, AbstractRecord rowForPrepare, String name) INTERNAL: Generates the stored procedure for this query using the row passed in for the check prepare. | |
| generateStoredProcedures | back to summary |
|---|---|
| public void generateStoredProcedures() PUBLIC: generates all the stored procedures using the schema manager. The schema manager may be set to write directly to the database on the a file. See outputDDLToWriter(Writer) and outputDDLToDatabase() on SchemaManager | |
| generateStoredProcedures | back to summary |
|---|---|
| public void generateStoredProcedures(Writer writerOrNull) PUBLIC: generates all the stored procedures to the writer using the schema manager outputDDLToWriter(Writer). | |
| generateUpdateStoredProcedure | back to summary |
|---|---|
| protected StoredProcedureDefinition generateUpdateStoredProcedure(ClassDescriptor descriptor) INTERNAL: Generates the update stored procedure for this descriptor | |
| getFieldName | back to summary |
|---|---|
| protected String getFieldName(String argumentName) INTERNAL: return the original field name based on the argument name. | |
| getFieldType | back to summary |
|---|---|
| protected Class INTERNAL: return the class corresponding to the passed in JDBC type. | |
| getPrefix | back to summary |
|---|---|
| public String getPrefix() | |
| getSession | back to summary |
|---|---|
| public AbstractSession getSession() | |
| getWriter | back to summary |
|---|---|
| public Writer getWriter() | |
| setPrefix | back to summary |
|---|---|
| public void setPrefix(String prefix) | |
| verify | back to summary |
|---|---|
| protected void verify() throws ValidationException INTERNAL: Verify that this project and descriptors do not have optimistic locking. | |
| writeDefinition | back to summary |
|---|---|
| public void writeDefinition(StoredProcedureDefinition definition) | |