public class P2OAccessWorker.Library
extends java.lang.Object
Constructor and Description |
---|
Library() |
Modifier and Type | Method and Description |
---|---|
void |
deleteDatabaseResourceReports()
Delete previous database resource report files, if any.
|
void |
fieldReferenced(java.lang.String field)
The given field has been referenced in business logic.
|
java.util.Iterator<P2JIndex> |
indexes(java.lang.String schemaname)
Obtains an iterator to the current record's list of indexes.
|
void |
indexReferenced(Aast ast,
java.lang.String index)
The given index in the given table has been referenced in business logic.
|
boolean |
isDenormalizedProperty(java.lang.String historical)
Check if given historical fully qualified property is denormalized.
|
boolean |
isDMOInterface(java.lang.String name)
Report whether the given class name is the unqualified name of any
DMO interface, in any schema tracked by the current P2J
configuration.
|
boolean |
isDMOInterface(java.lang.String name,
java.lang.String schema)
Report whether the given class name is the unqualified name of a DMO interface, in the
schema tracked by the current P2J configuration. |
boolean |
isForeignReference(java.lang.String historical)
Report whether the given, historical table will be mapped in the
converted application to a database table which represents a foreign
reference of another table's foreign key.
|
boolean |
isNullable(java.lang.String historical)
Indicate whether a DMO property is nullable.
|
boolean |
isReadOnly(java.lang.String historical)
Indicate whether a DMO class represents a read-only table, given its schema name.
|
boolean |
isValidatable(java.lang.String historical)
Indicate whether a DMO property can be validated at runtime, given
its legacy schema name.
|
java.lang.String |
javaBufferName(java.lang.String historical)
Look up the name of a Java DMO interface, given its legacy name,
and return the name of the default, implicit buffer associated with
this interface.
|
java.lang.String |
javaClassName(java.lang.String historical)
Look up the name of a Java DMO interface, given its legacy name.
|
java.lang.String |
javaGetterName(java.lang.String historical,
boolean isLogical)
Look up the name of the accessor (getter) method associated with the
DMO property which represents the specified, legacy database field.
|
java.lang.String |
javaGetterName(java.lang.String historical,
java.lang.Long index,
boolean isLogical)
Look up the name of the accessor (getter) method associated with the
DMO property which represents the specified, legacy database field.
|
java.lang.String |
javaInterfaceName(java.lang.String historical)
In the case of temp-tables, look up the name of a Java DMO super interface, given its legacy name.
|
java.lang.String |
javaPackage(java.lang.String historical)
Look up the package of a Java DMO interface, given its legacy name.
|
java.lang.String |
javaPropertyName(java.lang.String historical,
boolean qualified)
Look up the name of the name of the DMO property which represents
the specified, legacy database field.
|
java.lang.String |
javaPropertyName(java.lang.String historical,
boolean qualified,
java.lang.Long index)
Look up the name of the name of the DMO property which represents
the specified, legacy database field.
|
java.lang.String |
javaSetterName(java.lang.String historical)
Look up the name of the mutator (setter) method associated with the
DMO property which represents the specified, legacy database field.
|
java.lang.String |
javaSetterName(java.lang.String historical,
java.lang.Long index)
Look up the name of the mutator (setter) method associated with the
DMO property which represents the specified, legacy database field.
|
java.util.Set<java.lang.String> |
legacyFieldNames(java.lang.String historical,
boolean includeHidden)
Retrieve the full set of fully qualified, legacy field names for a
legacy Progress table.
|
java.util.Iterator<Aast> |
properties(java.lang.String schemaname)
Obtains an iterator to the current record's list of indexes.
|
void |
unindexedQuery(Aast ast,
java.lang.String comment)
Store information about queries with suspicious index selection.
|
void |
unindexedQueryReport()
Emit content (if any) for the current source file into the unindexed query report.
|
void |
unusedFieldReport(boolean temp)
Emit content (if any) for the current source file into the unused field report.
|
void |
unusedIndexReport(boolean temp)
Emit content (if any) for the current source file into the unused index report.
|
public java.util.Iterator<P2JIndex> indexes(java.lang.String schemaname)
schemaname
- The fully qualified schema name of the record being processed.public java.util.Iterator<Aast> properties(java.lang.String schemaname)
schemaname
- The fully qualified schema name of the record being processed.public java.lang.String javaPackage(java.lang.String historical) throws SchemaException
historical
- Fully qualified, legacy, Progress schema name for a table.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence.public java.lang.String javaClassName(java.lang.String historical) throws SchemaException
historical
- Fully qualified, legacy, Progress schema name for a table.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the table portion of historical
cannot be
resolved to a corresponding Java name.public java.lang.String javaInterfaceName(java.lang.String historical) throws SchemaException
historical
- Fully qualified, legacy, Progress schema name for a temp-table.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the table portion of historical
cannot be resolved to a corresponding Java name.public java.lang.String javaBufferName(java.lang.String historical) throws SchemaException
historical
- Fully qualified, legacy, Progress schema name for a table.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the table portion of historical
cannot be
resolved to a corresponding Java name.public java.lang.String javaPropertyName(java.lang.String historical, boolean qualified) throws SchemaException
historical
- Fully qualified, legacy, Progress schema name for a database field.qualified
- true
if property name should be qualified with
a buffer name; false
if it should remain
unqualified.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the field portion of historical
cannot be
resolved to a corresponding Java name.public java.lang.String javaPropertyName(java.lang.String historical, boolean qualified, java.lang.Long index) throws SchemaException
historical
- Fully qualified, legacy, Progress schema name for a database field.qualified
- true
if property name should be qualified with
a buffer name; false
if it should remain
unqualified.index
- Zero-based index of custom property name for denormalized field with extent,
otherwise null.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the field portion of historical
cannot be
resolved to a corresponding Java name.public java.util.Set<java.lang.String> legacyFieldNames(java.lang.String historical, boolean includeHidden) throws SchemaException
historical
- Fully qualified, legacy, Progress schema name for a table.includeHidden
- If true
the hidden fields are also included.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if historical
does not represent a known table.public java.lang.String javaGetterName(java.lang.String historical, boolean isLogical) throws SchemaException
get{PropertyName}or
is{PropertyName}if PropertyName represents a
logical
data type.historical
- Fully qualified, legacy, Progress schema name for a database field.isLogical
- true
if historical
represents a
logical
field, else false
.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the field portion of historical
cannot be
resolved to a corresponding Java name.public java.lang.String javaGetterName(java.lang.String historical, java.lang.Long index, boolean isLogical) throws SchemaException
get{PropertyName}or
is{PropertyName}if PropertyName represents a
logical
data type.historical
- Fully qualified, legacy, Progress schema name for a database field.index
- Zero-based index of custom property name for denormalized field with extent,
otherwise null.isLogical
- true
if historical
represents a
logical
field, else false
.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the field portion of historical
cannot be
resolved to a corresponding Java name.public java.lang.String javaSetterName(java.lang.String historical) throws SchemaException
set{PropertyName}
historical
- Fully qualified, legacy, Progress schema name for a database field.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the field portion of historical
cannot be
resolved to a corresponding Java name.public java.lang.String javaSetterName(java.lang.String historical, java.lang.Long index) throws SchemaException
set{PropertyName}
historical
- Fully qualified, legacy, Progress schema name for a
database field.index
- Zero-based index of custom property name for denormalized field with extent,
otherwise null.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence;
if the field portion of historical
cannot be
resolved to a corresponding Java name.public boolean isDenormalizedProperty(java.lang.String historical) throws SchemaException
historical
- Historical fully qualified property name.true
if given property is denormalized.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence.public boolean isValidatable(java.lang.String historical) throws SchemaException
historical
- Fully qualified, legacy Progress field name.true
if the field should be validated at
runtime, else false
.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence.public boolean isNullable(java.lang.String historical) throws SchemaException
historical
- Fully qualified, legacy Progress field name.true
if the field is nullable, else false
.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence.public boolean isReadOnly(java.lang.String historical) throws SchemaException
historical
- Fully qualified, legacy Progress table name.true
if the table is read-only, else false
.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence.public boolean isDMOInterface(java.lang.String name) throws SchemaException
name
- An unqualified class name.true
if name
collides with any
DMO interface in any schema, else false
.SchemaException
- if there is an error loading schema names from configuration.public boolean isDMOInterface(java.lang.String name, java.lang.String schema) throws SchemaException
schema
tracked by the current P2J configuration.name
- An unqualified class name.schema
- The name of the schema to look into.true
if name
is present as java name of a table from
the specified schema
and false
if schema
does not exist or it does not contain such interface.SchemaException
- if there is an error loading schema names from configuration.public boolean isForeignReference(java.lang.String historical) throws SchemaException
historical
- Fully qualified, legacy Progress table name.true
if the given table represents the foreign
end of a one-to-one or a one-to-many relation between two
tables.SchemaException
- if there is an error loading schema names from configuration.public void indexReferenced(Aast ast, java.lang.String index) throws SchemaException
ast
- Record phrase or embedded SQL AST node.index
- Legacy name of index which was referenced.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence.public void fieldReferenced(java.lang.String field) throws SchemaException
field
- Legacy name (normalized schemaname) of field which was referenced.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence.public void deleteDatabaseResourceReports()
public void unusedIndexReport(boolean temp) throws java.io.IOException
temp
- true
if content relates to temp-tables; false
for permanent
tables.java.io.IOException
- if there is an error writing the report.public void unusedFieldReport(boolean temp) throws java.io.IOException
temp
- true
if content relates to temp-tables; false
for permanent
tables.java.io.IOException
- if there is an error writing the report.public void unindexedQuery(Aast ast, java.lang.String comment)
ast
- Record phrase or embedded SQL AST.comment
- The comment to store.public void unindexedQueryReport() throws java.io.IOException, SchemaException
java.io.IOException
- if there is an error writing the report.SchemaException
- if there is any error loading P2J schema configuration data;
if there is any error loading the AST from persistence.