|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.tools.schemaframework.StoredProcedureGenerator
public class StoredProcedureGenerator
Purpose: To generate StoredProcedures from EclipseLink Projects
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:
Field Summary | |
---|---|
private static java.lang.String |
DEFAULT_PREFIX |
private java.util.Hashtable |
intToTypeConverterHash |
private java.util.Hashtable |
mappingStoredProcedures This hashtable is used to store the storedProcedure referenced by the mapping name. |
private static int |
MAX_NAME_SIZE |
private java.lang.String |
prefix |
SchemaManager |
schemaManager |
private java.util.Hashtable |
sequenceProcedures |
private java.util.Hashtable |
storedProcedures This hashtable is used to store the storedProcedure referenced by the class name. |
private java.io.Writer |
writer |
Constructor Summary | |
---|---|
StoredProcedureGenerator(SchemaManager schemaMngr) |
Method Summary | |
---|---|
protected void |
buildIntToTypeConverterHash() INTERNAL: Build all conversions based on JDBC return values. |
protected java.lang.String |
buildProcedureString(SQLCall call) INTERNAL: Given a call, this method produces the stored procedure string based on the SQL string inside the call. |
void |
generateAmendmentClass(java.io.Writer outputWriter, java.lang.String packageName, java.lang.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 java.util.Hashtable |
generateMappingStoredProcedures(ClassDescriptor descriptor) INTERNAL: Generates the mapping stored procedures for this descriptor. |
protected StoredProcedureDefinition |
generateObjectStoredProcedure(DatabaseQuery query, java.util.List fields, java.lang.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, java.util.Map fields, java.lang.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, java.util.List fields, org.eclipse.persistence.internal.sessions.AbstractRecord rowForPrepare, java.lang.String name) INTERNAL: Generates the stored procedure for this query using the row passed in for the check prepare. |
protected StoredProcedureDefinition |
generateStoredProcedure(DatabaseQuery query, java.util.List fields, java.lang.String name) INTERNAL: Generates the stored procedure for this query. |
void |
generateStoredProcedures() PUBLIC: generates all the stored procedures using the schema manager. |
void |
generateStoredProcedures(java.io.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 java.lang.String |
getFieldName(java.lang.String argumentName) INTERNAL: return the original field name based on the argument name. |
protected java.lang.Class |
getFieldType(java.lang.Object jdbcDataType) INTERNAL: return the class corresponding to the passed in JDBC type. |
java.lang.String |
getPrefix() |
org.eclipse.persistence.internal.sessions.AbstractSession |
getSession() |
java.io.Writer |
getWriter() |
void |
setPrefix(java.lang.String prefix) |
protected void |
verify() INTERNAL: Verify that this project and descriptors do not have optimistic locking. |
void |
writeDefinition(StoredProcedureDefinition definition) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public SchemaManager schemaManager
private java.util.Hashtable storedProcedures
private java.util.Hashtable mappingStoredProcedures
private java.util.Hashtable intToTypeConverterHash
private java.io.Writer writer
private java.lang.String prefix
private static final java.lang.String DEFAULT_PREFIX
private java.util.Hashtable sequenceProcedures
private static final int MAX_NAME_SIZE
Constructor Detail |
---|
public StoredProcedureGenerator(SchemaManager schemaMngr)
Method Detail |
---|
protected void buildIntToTypeConverterHash()
protected java.lang.String buildProcedureString(SQLCall call)
public void generateAmendmentClass(java.io.Writer outputWriter, java.lang.String packageName, java.lang.String className) throws ValidationException
ValidationException
protected StoredProcedureDefinition generateDeleteStoredProcedure(ClassDescriptor descriptor)
protected StoredProcedureDefinition generateInsertStoredProcedure(ClassDescriptor descriptor)
protected java.util.Hashtable generateMappingStoredProcedures(ClassDescriptor descriptor)
protected StoredProcedureDefinition generateObjectStoredProcedure(DatabaseQuery query, java.util.List fields, java.lang.String namePrefix)
protected StoredProcedureDefinition generateOneToManyMappingDeleteAllProcedure(OneToManyMapping mapping)
protected StoredProcedureDefinition generateOneToManyMappingProcedures(OneToManyMapping mapping, DatabaseQuery query, java.util.Map fields, java.lang.String namePrefix)
protected StoredProcedureDefinition generateOneToManyMappingReadProcedure(OneToManyMapping mapping)
protected StoredProcedureDefinition generateReadAllStoredProcedure(ClassDescriptor descriptor)
protected StoredProcedureDefinition generateReadStoredProcedure(ClassDescriptor descriptor)
protected void generateSequenceStoredProcedures(Project project)
protected StoredProcedureDefinition generateStoredProcedure(DatabaseQuery query, java.util.List fields, java.lang.String name)
protected StoredProcedureDefinition generateStoredProcedure(DatabaseQuery query, java.util.List fields, org.eclipse.persistence.internal.sessions.AbstractRecord rowForPrepare, java.lang.String name)
public void generateStoredProcedures()
public void generateStoredProcedures(java.io.Writer writerOrNull)
protected StoredProcedureDefinition generateUpdateStoredProcedure(ClassDescriptor descriptor)
protected java.lang.String getFieldName(java.lang.String argumentName)
protected java.lang.Class getFieldType(java.lang.Object jdbcDataType)
public java.lang.String getPrefix()
public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
public java.io.Writer getWriter()
public void setPrefix(java.lang.String prefix)
protected void verify() throws ValidationException
ValidationException
public void writeDefinition(StoredProcedureDefinition definition)
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |