|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides a hook by which some of the SQL executed by TJDO can be altered before execution. This is termed post-processing because it occurs as a last step after any processing performed by TJDO itself, such as expansion of SQL identifier macros. Post-processing can be used, for example, to expand user-defined macros in the SQL text, or (more ambitiously) to alter syntax to accommodate differences among SQL vendors.
Post-processor classes are specified by name in a "sql-post-processor" extension of JDO metadata. Classes implementing this interface must have a no-arg constructor.
The only SQL eligible for post-processing is that which originates from user code in the first place, namely:
Method Summary | |
java.lang.String |
processSql(java.lang.String stmts,
SchemaManager schemaMgr,
java.lang.Class pcClass)
Called to perform optional post-processing of SQL statements prior to execution by TJDO. |
Method Detail |
public java.lang.String processSql(java.lang.String stmts, SchemaManager schemaMgr, java.lang.Class pcClass)
If processing fails this method may throw an unchecked exception, which will abort whatever operation was in progress and, in most cases, be propagated all the way back out to user code. If implementations do so it is recommended they throw a JDOUserException, or some subclass thereof.
stmts
- The text of one or more SQL statements, separated by a semi-colon.schemaMgr
- The schema manager of the schema in which the SQL will be executed.pcClass
- The persistent-capable class for which the SQL is being performed,
or null
if the statements do not pertain to any
particular class. When creating views, this is the view's PC class.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |