public class TableHints
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Object,java.lang.Object> |
associations
Association definitions for this table
|
private static java.lang.String |
ATTR_DIRECTION
Direction attribute of index field element
|
private static java.lang.String |
ATTR_DMO
Dmo attribute of table element
|
private static java.lang.String |
ATTR_DROP
Drop attribute of table and field elements
|
private static java.lang.String |
ATTR_ENCODED
Encoded attribute of field element
|
private static java.lang.String |
ATTR_FOREIGN
Foreign attribute of association elements
|
private static java.lang.String |
ATTR_MATCH
Match attribute of phrase element
|
private static java.lang.String |
ATTR_NAME
Name attribute of table and field elements
|
private static java.lang.String |
ATTR_NO_INHERIT
No-inherit attribute of phrase element
|
private static java.lang.String |
ATTR_PROPERTY
Property attribute of field element
|
private static java.lang.String |
ATTR_READ_ONLY
Read-only attribute of table
|
private static java.lang.String |
ATTR_REFERENCES
References attribute of phrase element
|
private static java.lang.String |
ATTR_REPLACE
Replace attribute of phrase element
|
private static java.lang.String |
ATTR_SQL_COLUMN
Sql-column attribute of field element
|
private static java.lang.String |
ATTR_SQL_SIZE
SQL-size attribute to define a SQL size hint for character fields
|
private static java.lang.String |
ATTR_SQL_TABLE
Sql-table attribute of table element
|
private static java.lang.String |
ATTR_TEMP
Temp-table raw (pre-conversion) name attribute
|
private static java.lang.String |
ATTR_TYPE
Type attribute of association element
|
private static java.lang.String |
ATTR_UNIQUE
Unique attribute of index element
|
private java.util.Map<java.lang.String,java.util.List<ExtentHintField>> |
customExtents
Map containing information about custom conversion of fields with extents
|
private java.lang.String |
dmo
Dmo conversion replacement for the table.
|
private static java.lang.String |
ELEM_ASSOCIATION
Relational association between this table and another
|
private static java.lang.String |
ELEM_CUSTOM_EXTENT
Element to define custom processing table fields with extent
|
private static java.lang.String |
ELEM_DISP
Disposition element to define a type of import processing
|
private static java.lang.String |
ELEM_EXTENT_NAME
Element to define configurable, depending on customer preferences naming conversion
field with extent
|
private static java.lang.String |
ELEM_FIELD
Field element of table and association elements
|
private static java.lang.String |
ELEM_INDEX
Synthetic index element
|
private static java.lang.String |
ELEM_INDEX_FIELD
Field element of index
|
private static java.lang.String |
ELEM_PHRASE
Phrase element to define a customized name conversion
|
private java.util.Set<java.lang.String> |
encodedFields
Fields which require base-64 encoding for storage
|
private java.lang.Boolean |
escaped
Table escape attribute, null means that attribute is not set.
|
private java.util.Map<java.lang.String,java.lang.Boolean> |
escapedFields
Field escape attributes.
|
private java.util.Map<java.lang.String,java.util.Set<java.lang.String>> |
fieldDisp
Field dispositions for this table
|
private java.util.Set<java.lang.String> |
fieldDrop
Field drop flags for this table
|
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
fieldPhrases
Name conversion replacements for fields within table
|
private java.util.Map<java.lang.String,java.util.Map> |
indexes
Map containing information about synthetic indexes and their fields
|
private java.util.Map<java.lang.String,java.lang.String> |
inheritPhrases
Name conversion replacements for the table inherited by fields
|
private static java.lang.String |
KEY_FIELDS
Key under which join fields are stored in an association map
|
private static java.lang.String |
KEY_INDEX_FIELDS
Key under which index fields are stored in the indexes map
|
private static int |
MAX_SQL_SIZE
Maximum size of a character field in Progress is about 32K.
|
private java.lang.String |
name
Name of table described by this hint instance
|
private java.util.Map<java.lang.String,java.lang.String> |
noInheritPhrases
Name conversion replacements for the table not inherited by fields
|
private java.util.Map<java.lang.String,java.lang.String> |
properties
DMO properties conversion replacements for the table.
|
private boolean |
readOnly
Flag indicating that the table is read-only
|
private java.util.Map<java.lang.String,java.lang.String> |
sqlColumns
SQL columns conversion replacements for the table.
|
private java.util.Map<java.lang.String,java.lang.Integer> |
sqlSizes
SQL sizes for (character) fields extracted from .hints file.
|
private java.lang.String |
sqlTable
SQL table conversion replacement for the table.
|
private java.util.Set<java.lang.String> |
tableDisp
Table dispositions for this table
|
private boolean |
tableDrop
Table drop flag for this table
|
private java.lang.String |
tempTableName
Pre-conversion name of temp-table based upon underlying table
|
private static java.lang.String |
TYPE_MANY_TO_ONE
Value of type for many-to-one association
|
private static java.lang.String |
TYPE_ONE_TO_MANY
Value of type for one-to-many association
|
private static java.lang.String |
TYPE_ONE_TO_ONE
Value of type for one-to-one association
|
Constructor and Description |
---|
TableHints(org.w3c.dom.Element table)
Constructor which configures hint from an XML element.
|
Modifier and Type | Method and Description |
---|---|
java.util.Iterator |
associatedTables()
Get an iterator on the names of all tables referenced by relational
associations from this table, in no particular order.
|
java.util.Set |
getAssociatedFields(java.lang.String references)
Get the set of field names which are used to form a relational
association between the table described by this hint and the table
it references.
|
int |
getAssociationType(java.lang.String references)
Get the schema parser token type associated with the association (if
any) described by this hint between this table and the table it
references.
|
java.util.List<ExtentHintField> |
getCustomFieldExtent(java.lang.String fieldName)
Get the list of extent property names for given field with extent:
several property names in case of custom extent conversion.
|
java.lang.String |
getDmo()
Get the custom DMO conversion replacement for the table.
|
java.util.List<java.lang.String> |
getFieldDispositions(java.lang.String field)
Get the list of field dispositions defined for the table described by this hint.
|
java.util.Set |
getIndexFieldNames(java.lang.String indexName)
Get the set of field names of the specified index.
|
java.util.Set<java.lang.String> |
getIndexNames()
Get the set of synthetic index names.
|
java.lang.String |
getName()
Get the name of the table described by this hint.
|
java.util.Map<java.lang.String,java.lang.String> |
getNameReplacements()
Get the custom replacement map (if any) used for name conversion for
this table.
|
java.util.Map<java.lang.String,java.lang.String> |
getNameReplacements(java.lang.String field)
Get the custom replacement map (if any) used for name conversion for
the specified field in this table.
|
java.lang.String |
getProperty(java.lang.String field)
Get the custom name used for conversion of DMO property for the specified field in this
table.
|
java.lang.String |
getSqlColumn(java.lang.String field)
Get the custom name used for conversion of sql column for the specified field in this
table.
|
java.lang.Integer |
getSqLSizeHint(java.lang.String field)
Get the SQL size hint for a (character) field.
|
java.lang.String |
getSqlTable()
Get the custom replacement name used for sql table conversion.
|
java.util.List<java.lang.String> |
getTableDispositions()
Get the list of table dispositions defined for the table described
by this hint.
|
java.lang.String |
getTempTableName()
Get the pre-conversion name of a temp table which is based upon the
underlying table.
|
java.lang.Boolean |
isEscaped()
Report whether the database table name for this table should be escaped.
|
boolean |
isFieldDropped(java.lang.String field)
Indicate whether the field of the table described by this hint is
to be dropped during the database import.
|
boolean |
isFieldEncoded(java.lang.String field)
Report whether the specified field must be base-64 encoded for data
storage (and decoded upon retrieval).
|
java.lang.Boolean |
isFieldEscaped(java.lang.String field)
Report whether the database column name for specified field should be escaped.
|
boolean |
isForeignAssociation(java.lang.String references)
Indicate whether the table described by this hint represents the
foreign key end of an association with the specified table.
|
boolean |
isIndexFieldDescending(java.lang.String indexName,
java.lang.String fieldName)
Determine whether the specified field in the specified index is sorted
in the descending order.
|
boolean |
isIndexUnique(java.lang.String indexName)
Determine whether the specified index is unique.
|
boolean |
isReadOnly()
Indicate whether the table described by this hint is read-only
|
boolean |
isTableDropped()
Indicate whether the table described by this hint is to be dropped
during the database import.
|
private static final java.lang.String ELEM_FIELD
private static final java.lang.String ELEM_PHRASE
private static final java.lang.String ELEM_DISP
private static final java.lang.String ELEM_ASSOCIATION
private static final java.lang.String ELEM_INDEX
private static final java.lang.String ELEM_INDEX_FIELD
private static final java.lang.String ELEM_CUSTOM_EXTENT
private static final java.lang.String ELEM_EXTENT_NAME
private static final java.lang.String ATTR_NAME
private static final java.lang.String ATTR_READ_ONLY
private static final java.lang.String ATTR_DROP
private static final java.lang.String ATTR_TEMP
private static final java.lang.String ATTR_ENCODED
private static final java.lang.String ATTR_UNIQUE
private static final java.lang.String ATTR_DIRECTION
private static final java.lang.String ATTR_TYPE
private static final java.lang.String ATTR_MATCH
private static final java.lang.String ATTR_REPLACE
private static final java.lang.String ATTR_NO_INHERIT
private static final java.lang.String ATTR_REFERENCES
private static final java.lang.String ATTR_FOREIGN
private static final java.lang.String ATTR_DMO
private static final java.lang.String ATTR_SQL_TABLE
private static final java.lang.String ATTR_PROPERTY
private static final java.lang.String ATTR_SQL_COLUMN
private static final java.lang.String ATTR_SQL_SIZE
private static final java.lang.String KEY_FIELDS
private static final java.lang.String KEY_INDEX_FIELDS
private static final java.lang.String TYPE_MANY_TO_ONE
private static final java.lang.String TYPE_ONE_TO_MANY
private static final java.lang.String TYPE_ONE_TO_ONE
private static final int MAX_SQL_SIZE
private java.lang.Boolean escaped
private final java.util.Map<java.lang.String,java.lang.Boolean> escapedFields
private java.lang.String dmo
private java.lang.String sqlTable
private final java.util.Map<java.lang.String,java.lang.String> properties
private final java.util.Map<java.lang.String,java.lang.String> sqlColumns
private final java.util.Map<java.lang.String,java.lang.String> inheritPhrases
private final java.util.Map<java.lang.String,java.lang.String> noInheritPhrases
private final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> fieldPhrases
private final java.util.Map<java.lang.String,java.lang.Integer> sqlSizes
private final java.util.Set<java.lang.String> encodedFields
private final java.util.Map<java.lang.Object,java.lang.Object> associations
private final java.util.Set<java.lang.String> tableDisp
private final java.util.Set<java.lang.String> fieldDrop
private final java.util.Map<java.lang.String,java.util.Set<java.lang.String>> fieldDisp
private final java.util.Map<java.lang.String,java.util.Map> indexes
private java.util.Map<java.lang.String,java.util.List<ExtentHintField>> customExtents
private final java.lang.String name
private final java.lang.String tempTableName
private final boolean tableDrop
private final boolean readOnly
public TableHints(org.w3c.dom.Element table)
table
- XML element describing the table hint. Corresponds with
table
tag within the hints file.public java.lang.String getName()
public java.lang.String getTempTableName()
null
if no explicit temp-table name exists.public java.lang.String getDmo()
null
if property hint is not
specified in any of these attributes.public java.lang.String getSqlTable()
null
if property hint is not
specified in any of these attributes.public java.lang.String getProperty(java.lang.String field)
field
- Name of the field for retrieve "property" attribute or
"sqlColumn" attribute.null
if property hint is not specified in any of
these attributes.public java.lang.String getSqlColumn(java.lang.String field)
field
- Name of the field for retrieve "sqlColumn" attribute or
"property" attribute.null
if property hint is not specified in any of
these attributes.public java.util.Map<java.lang.String,java.lang.String> getNameReplacements()
null
.public java.util.Map<java.lang.String,java.lang.String> getNameReplacements(java.lang.String field)
field
- Name of the field for which to retrieve replacement phrases.null
.public java.lang.Integer getSqLSizeHint(java.lang.String field)
null
is
returned.field
- Name of the field for which to retrieve sql size hint.null
if not defined.public boolean isFieldEncoded(java.lang.String field)
field
- Name of the field to test for the "encoded"
attribute.true
if data must be base-64 encoded/decoded.public java.lang.Boolean isFieldEscaped(java.lang.String field)
field
- Name of the field to test for escaping.true
if column should be escaped, false
if column
should not be escaped, null
if attribute "escape" is set
neither for field nor for table.public java.lang.Boolean isEscaped()
true
if table name should be escaped, false
if table
name should not be escaped, null
if attribute "escape" is
set not set for this table.public java.util.Iterator associatedTables()
public int getAssociationType(java.lang.String references)
MANY_TO_ONE
ONE_TO_MANY
ONE_TO_ONE
references
- Name of table which the association references.-1
if either the
association does not exist, or an unrecognized association
type was found.public boolean isForeignAssociation(java.lang.String references)
references
- Name of table which the association references.true
if this table contains a foreign key for
the referenced table. false
if not, or if no
association was found with table references
.public java.util.List<ExtentHintField> getCustomFieldExtent(java.lang.String fieldName)
fieldName
- Field name.public java.util.Set getAssociatedFields(java.lang.String references)
references
- Name of table which the association references.null
if this hint does not
describe the referenced association or describes only the
basic attributes of the association and not the joining
fields.public boolean isTableDropped()
true
if this table is to be dropped.public boolean isReadOnly()
true
if this table is read-only.public boolean isFieldDropped(java.lang.String field)
field
- field name to query.true
if this table is to be dropped.public java.util.List<java.lang.String> getTableDispositions()
public java.util.List<java.lang.String> getFieldDispositions(java.lang.String field)
field
- field name to get the dispositions for.public java.util.Set<java.lang.String> getIndexNames()
public boolean isIndexFieldDescending(java.lang.String indexName, java.lang.String fieldName)
indexName
- The name of the index that contains the required field.fieldName
- Field name to query.true
if the required field is sorted in the
descending order. false
otherwise.public boolean isIndexUnique(java.lang.String indexName)
indexName
- Index to query.true
if the required index is unique.
false
otherwise.public java.util.Set getIndexFieldNames(java.lang.String indexName)
indexName
- The name of the index to get the field names for.