public final class P2OAccessWorker extends AbstractPatternWorker implements DataModelTokenTypes
Currently, this worker supports lookups of converted Java schema names, based upon legacy, Progress schema names as input. Specifically, given a fully qualified, Progress database table name, the Java name for the corresponding Data Model Object (DMO) class can be retrieved. The Java name of the implicit (default) buffer for that table is also available. Given a fully qualified, Progress database field name, the Java name for the corresponding DMO getter and setter methods can be retrieved.
Modifier and Type | Class and Description |
---|---|
class |
P2OAccessWorker.Library
Helper to lookup Java names for tables and fields, given their
historical, Progress names.
|
private static class |
P2OAccessWorker.QueryIndexInfo
Helper class which keeps track of queries with suspicious index selection, and which
writes content to the unindexed query report.
|
private static class |
P2OAccessWorker.WorkArea
Context local work area.
|
Modifier and Type | Field and Description |
---|---|
private static ContextLocal<P2OAccessWorker.WorkArea> |
context
Context local work area.
|
private static java.util.Collection<java.lang.Integer> |
types
Table token types
|
BOOL_FALSE, BOOL_TRUE, CLASS, COMPOSITE, CONSTR_COL, DATA_MODEL, DATE_LITERAL, DATETIME_LITERAL, DATETIME_TZ_LITERAL, DEC_LITERAL, FOREIGN, GENERATOR, INDEX, INDEX_COL, INITIAL, MANY_TO_ONE, NULL_LITERAL, NUM_LITERAL, ONE_TO_MANY, ONE_TO_ONE, PRIMARY, PROPERTY, RELATION_COL, SEQUENCE, STRING, TABLE, TRIGGER, UNIQUE, UNKNOWN
Constructor and Description |
---|
P2OAccessWorker()
Default constructor which initializes libraries.
|
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
getTableName(Aast ast)
Extract the target table (or temp/work-table or buffer) name from the given AST, which is
expected to be of type
RECORD_PHRASE or EMBEDDED_SQL . |
java.lang.Object |
resolveConstant(java.lang.String constant)
Resolve
constant to a literal which can be compiled into
expressions. |
void |
visitAst(Aast ast)
This method is called each time a new AST is visited, just before the
pattern engine processes that AST.
|
finish, getCopy, getLibrary, getResolver, getSource, initialize, isConditionalRuleSets, isFlagActivated, isRuntimeQueryMode, registerTree, setLibrary
private static final java.util.Collection<java.lang.Integer> types
private static final ContextLocal<P2OAccessWorker.WorkArea> context
public P2OAccessWorker()
private static java.lang.String getTableName(Aast ast) throws SchemaException
RECORD_PHRASE
or EMBEDDED_SQL
.ast
- Record phrase or embedded SQL AST.SchemaException
- if an unexpected AST node is passed to this method.public void visitAst(Aast ast)
P2OLookup
class' state. This enables us to resolve references to temp and work
tables, which are local to the currently loaded source file AST.visitAst
in interface PatternWorker
visitAst
in class AbstractPatternWorker
ast
- The root node of the source AST about to be processed by the
pattern engine.public java.lang.Object resolveConstant(java.lang.String constant)
constant
to a literal which can be compiled into
expressions.resolveConstant
in interface PatternWorker
resolveConstant
in class AbstractPatternWorker
constant
- Constant indicating a data model token name.