K
- The type of the key used by the primary internal structure of the mapper. For permanent DMOs,
this will be a Class<? extends DataModelObject>
. For temporary DMOs, this will be an
Integer
value with the UNIQUE-ID
identifying the TempTable
resource.public abstract class TableMapper<K>
extends java.lang.Object
TableMapper.LegacyTableInfo
instance.
For physical DBs, the mappings for the permanent DBs (connected at server startup) will be registered at server startup. For permanent DBs connected at application runtime, the mappings will be registered and deregistered at the appropriate DB connection/disconnection times.
All the mappings for temporary tables will be registered during application lifetime, as the temp tables get created or dropped.
APIs which resolve a legacy name for a converted name may return null, when resolving an index,
field or property name; this is to allow checks for synthetic properties or indexes, which do
not exist in the legacy code. In all cases, it is expected that the given table name is for a
table which has registered mappings; else, a NullPointerException
will be thrown.
Modifier and Type | Class and Description |
---|---|
static class |
TableMapper.LegacyFieldInfo
A container with a field's legacy and DMO property name and field attributes.
|
(package private) static class |
TableMapper.LegacyIndexComponentInfo
A container with an index component information.
|
static class |
TableMapper.LegacyIndexInfo
A container with a index information, holding index attributes and components.
|
private static class |
TableMapper.LegacyTableInfo
A container with the legacy info for a table.
|
private static class |
TableMapper.LegacyTriggerInfo
A container with a trigger information.
|
private static class |
TableMapper.PermanentTableMapper
Mapper for permanent tables.
|
private static class |
TableMapper.TempTableMapper
Mapper for temporary tables.
|
Modifier and Type | Field and Description |
---|---|
private static ContextLocal<java.util.Map<java.lang.Class<?>,java.util.Set<java.lang.String>>> |
contextLabelQuirks
Map containing fields for which the quirk has been triggered.
|
private static ContextLocal<TableMapper.TempTableMapper> |
dynamicDB
Context-local mapper for all dynamic temporary tables.
|
private static java.util.Map<java.lang.String,TableMapper.PermanentTableMapper> |
permanentDBs
Holds the mappers for all permanent databases by their schema name
|
private java.lang.String |
schema
The schema name
|
private static ContextLocal<TableMapper.TempTableMapper> |
staticTempDB
Holds the mapper for all statically defined temp tables.
|
Modifier | Constructor and Description |
---|---|
private |
TableMapper(java.lang.String schema)
Create a new mapper for the given schema.
|
Modifier and Type | Method and Description |
---|---|
(package private) abstract TableMapper.LegacyTableInfo |
byKey(K key)
Get the
TableMapper.LegacyTableInfo instance mapped to a specific key . |
(package private) abstract void |
clear()
Clear all the mappings.
|
abstract java.lang.String |
denormalizedProperty(K key,
java.lang.String property,
java.lang.Integer index)
Get new field name for denormalized legacy field name and index.
|
private static java.lang.String |
extractPropertyName(TableMapper.LegacyTableInfo tableInfo,
TableMapper.LegacyFieldInfo fieldInfo,
java.lang.Integer index)
Get the property name for the specified table info, field info and null-based index.
|
(package private) static P2JIndex |
findJoiningIndex(RecordBuffer buffer,
java.util.Set<java.lang.String> commonFields)
Given a table and a map of fields which this table class has in common (by name and type)
with another table, find the index which can be used to join this table with the other.
|
static java.util.List<TableMapper.LegacyFieldInfo> |
getAllLegacyFieldInfo(TempTable tt)
Get an ordered list of all
TableMapper.LegacyFieldInfo items for the given
temp-table. |
(package private) static java.util.Set<java.lang.String> |
getCommonFields(RecordBuffer buf1,
RecordBuffer buf2)
Compose a set of legacy field names which represents the intersection of the fields (by name
and type) of the two tables.
|
static java.lang.String |
getDenormalizedProperty(RecordBuffer recBuf,
java.lang.String property,
java.lang.Integer index)
Get new field name for denormalized legacy field name and index.
|
static java.lang.Class<? extends Record> |
getDMOClass(java.lang.String schema,
java.lang.String table)
Get the DMO implementation class for the legacy table name (part of the specified schema).
|
static java.lang.String |
getExtent4GLName(java.lang.Class<? extends DataModelObject> dmoIface,
java.lang.String property)
Get the 4GL name of the extent field represented by the given property.
|
(package private) static java.util.Set<java.lang.String> |
getIndexFieldNames(P2JIndex index)
Compose a set of all legacy field names defined for the given index.
|
static java.lang.String |
getIndexName(java.lang.String schema,
java.lang.String table,
java.lang.String idx)
Resolve the converted index name for a legacy index belonging to the specified legacy table.
|
static java.lang.String |
getIndexName(TempTable table,
java.lang.String idx)
Resolve the converted index name for a legacy index belonging to the temp-table defined
by the
TempTable resource. |
(package private) java.lang.String |
getIndexNameImpl(K legacyKey,
java.lang.String idx)
Get the converted index name for the specified legacy index.
|
static java.lang.String |
getLegacyFieldColumnLabel(RecordBuffer recBuf,
java.lang.String property)
Get the COLUMN-LABEL field attribute for the property associated with the DMO referenced
by the given buffer.
|
static int |
getLegacyFieldDecimals(RecordBuffer recBuf,
java.lang.String property)
Get the DECIMALS field attribute for the property associated with the DMO referenced by the
given buffer.
|
static java.lang.String |
getLegacyFieldFormat(RecordBuffer recBuf,
java.lang.String property)
Get the FORMAT field attribute for the property associated with the DMO referenced by the given buffer.
|
static java.lang.String |
getLegacyFieldHelp(RecordBuffer recBuf,
java.lang.String property)
Get the HELP field attribute for the property associated with the DMO referenced by the
given buffer.
|
static integer |
getLegacyFieldId(RecordBuffer recBuf,
java.lang.String property)
Get the id of field in the sequence of the fields of the buffer.
|
static TableMapper.LegacyFieldInfo |
getLegacyFieldInfo(DmoMeta dmoInfo,
java.lang.String property)
Get the legacy field for the given property, which is defined by a DMO representing a table in a
permanent database.
|
static TableMapper.LegacyFieldInfo |
getLegacyFieldInfo(RecordBuffer recBuff,
java.lang.String property)
Get the legacy field info for the property associated with the DMO referenced by the given buffer.
|
static TableMapper.LegacyFieldInfo |
getLegacyFieldInfo(TempTable tt,
java.lang.String property)
Get the legacy field for the given
TempTable resource and property. |
static java.lang.String |
getLegacyFieldInitial(RecordBuffer recBuf,
java.lang.String property)
Get the INITIAL field attribute for the property associated with the DMO referenced by the
given buffer.
|
static java.lang.String |
getLegacyFieldLabel(RecordBuffer recBuf,
java.lang.String property)
Get the LABEL field attribute for the property associated with the DMO referenced by the given buffer.
|
static logical |
getLegacyFieldLiteralQuestion(RecordBuffer recBuf,
java.lang.String property)
Get the LITERAL-QUESTION field attribute for the property associated with the DMO
referenced by the given buffer.
|
static java.lang.String |
getLegacyFieldName(java.lang.Class<? extends DataModelObject> dmoIface,
java.lang.String property)
Get the legacy field name for the given property, which is defined by a DMO part of a permanent DB.
|
static java.lang.String |
getLegacyFieldName(RecordBuffer recBuf,
java.lang.String property)
Get the legacy field name for the property associated with the DMO referenced by the given buffer.
|
static java.lang.String |
getLegacyFieldName(TempTable tt,
java.lang.String property)
Get the legacy field name for the given
TempTable resource and property. |
(package private) static LegacyFieldNameMap |
getLegacyFieldNameMap(RecordBuffer buffer)
A helper method to return bi-directional mapping of (lower case) legacy field names to
their DMO property counterparts, optimized to gather information about all fields at once.
|
static int |
getLegacyFieldPosition(RecordBuffer recBuf,
java.lang.String property)
Get the POSITION field attribute for the property associated with the DMO
referenced by the given buffer.
|
static java.lang.String |
getLegacyFieldValidateExpression(RecordBuffer recBuf,
java.lang.String property)
Get the VALIDATE-EXPRESSION field attribute for the property associated with the DMO
referenced by the given buffer.
|
static java.lang.String |
getLegacyFieldValidateMessage(RecordBuffer recBuf,
java.lang.String property)
Get the VALIDATE-MESSAGE field attribute for the property associated with the DMO
referenced by the given buffer.
|
(package private) static TableMapper.LegacyIndexInfo |
getLegacyIndexInfo(java.lang.Class<? extends DataModelObject> dmoIface,
int indexNum)
Get information about the index associated with the given DMO class, as a string.
|
(package private) static TableMapper.LegacyIndexInfo |
getLegacyIndexInfo(RecordBuffer recBuf,
int indexNum)
Get information about the index associated with the DMO referenced by the given buffer,
as a string.
|
static java.lang.String |
getLegacyIndexInfo(TempTable tt)
Get a string-representation of this buffer's indexes.
|
static TableMapper.LegacyIndexInfo |
getLegacyIndexInfo(TempTable tt,
int indexNum)
Get information about the index associated with the given temporary table, as a string.
|
static java.lang.String |
getLegacyIndexInfoString(RecordBuffer recBuf,
int indexNum)
Get information about the index associated with the DMO referenced by the given buffer,
as a string.
|
static java.lang.String |
getLegacyIndexName(java.lang.Class<? extends DataModelObject> dmoIface,
java.lang.String idx)
Get the legacy name of a converted index, which is defined by the backing table for the
specified buffer, part of a permanent DB.
|
static java.lang.String |
getLegacyIndexName(RecordBuffer recBuf,
java.lang.String idx)
Get the legacy index name of a converted index, defined by the backing table of the
specified buffer.
|
static java.lang.String |
getLegacyIndexName(TempTable tt,
java.lang.String idx)
Get the legacy index name for the given
TempTable resource and converted index name. |
static java.lang.String |
getLegacyName(RecordBuffer recBuf)
Get the legacy table name for the DMO referenced by the given buffer.
|
static java.util.List<TableMapper.LegacyFieldInfo> |
getLegacyOrderedList(Buffer buffer,
boolean noHidden)
Obtain the list of all legacy field information, sorted in ascending order:
by the ORDER schema attribute, if the parent table is a temp-table which was defined
with LIKE-SEQUENTIAL option;
by the POSITION schema attribute otherwise.
|
static java.util.List<java.lang.String> |
getLegacyProperties(java.lang.Class<? extends DataModelObject> dmoIface)
Get the legacy fields' list which are defined by a DMO part of a permanent DB.
|
static java.lang.String |
getLegacySchemaName(java.lang.Class<? extends DataModelObject> dmoIface)
Get the schema name for the given DMO, which is the schema concatenated with the legacy table name.
|
static TableMapper.LegacyTriggerInfo |
getLegacyTriggerInfo(java.lang.Class<? extends DataModelObject> dmoIface,
java.lang.String event,
java.lang.String property)
Get information about the trigger associated with the given DMO class and event.
|
static java.lang.String |
getLegacyTriggerProcedure(java.lang.Class<? extends DataModelObject> dmoIface,
java.lang.String event,
java.lang.String property)
Get the procedure of a trigger associated with the given DMO class and event, as a string.
|
static int |
getNumFields(java.lang.String schema,
java.lang.String table)
Get the number of fields belonging to the specified legacy table.
|
static int |
getNumFields(TempTable table)
Resolve the number of fields belonging to the specified
TempTable resource. |
(package private) int |
getNumFieldsImpl(K legacyKey)
Get the number of fields in the table mapped to the given key.
|
static java.lang.String |
getPropertyName(java.lang.Class<? extends DataModelObject> dmoIface,
int fieldId)
Get the DMO property name for a field index belonging to the specified legacy table.
|
static java.lang.String |
getPropertyName(RecordBuffer recBuff,
java.lang.String legacyFieldName)
Get the DMO property name for the given buffer and legacy field name.
|
static java.lang.String |
getPropertyName(java.lang.String schema,
java.lang.String table,
int fieldId)
Get the DMO property name for a field index belonging to the specified legacy table.
|
static java.lang.String |
getPropertyName(java.lang.String schema,
java.lang.String table,
int fieldId,
java.lang.Integer index)
Get the DMO property name for a field index belonging to the specified legacy table.
|
static java.lang.String |
getPropertyName(java.lang.String schema,
java.lang.String table,
java.lang.String field)
Get the DMO property name for a legacy field name belonging to the specified legacy table.
|
static java.lang.String |
getPropertyName(java.lang.String schema,
java.lang.String table,
java.lang.String field,
java.lang.Integer index)
Get the DMO property name for a legacy field name belonging to the specified legacy table.
|
static java.lang.String |
getPropertyName(TempTable table,
int fieldId)
Resolve the DMO property name for a field index name belonging to the specified
TempTable resource. |
static java.lang.String |
getPropertyName(TempTable table,
int fieldId,
java.lang.Integer index)
Resolve the DMO property name for a field index name belonging to the specified
TempTable resource. |
static java.lang.String |
getPropertyName(TempTable table,
java.lang.String field)
Resolve the DMO property name for a legacy field name belonging to the specified
TempTable resource. |
static java.lang.String |
getPropertyName(TempTable table,
java.lang.String field,
java.lang.Integer index)
Resolve the DMO property name for a legacy field name belonging to the specified
TempTable resource. |
(package private) java.lang.String |
getPropertyNameImpl(K legacyKey,
int fieldId,
java.lang.Integer index)
Get the property name for the specified field index.
|
(package private) java.lang.String |
getPropertyNameImpl(K legacyKey,
java.lang.String field,
java.lang.Integer index)
Get the property name for the specified field.
|
static boolean |
hasValidation(java.lang.Class<? extends DataModelObject> dmoIface)
Determine if the permanent table has table-level delete validation.
|
static logical |
isLegacyFieldMandatory(RecordBuffer recBuf,
java.lang.String property)
Get the MANDATORY field attribute for the property associated with the DMO
referenced by the given buffer.
|
static boolean |
isLegacyTriggerOverrideable(java.lang.Class<? extends DataModelObject> dmoIface,
java.lang.String event,
java.lang.String property)
Determine if the trigger associated with the given DMO class and event, is overridable.
|
private static TableMapper.PermanentTableMapper |
locatePerm(java.lang.String schema)
Locate the
TableMapper.PermanentTableMapper instance for the given schema. |
private static TableMapper.TempTableMapper |
locateTemp(TempTable tt)
Locate the appropriate
TableMapper.TempTableMapper for the given temp-table. |
static void |
mapPermanentDMO(DmoMeta dmoInfo)
Add the legacy mappings for the specified DMO.
|
(package private) static void |
mapTemporaryTable(TempTable table)
Add the legacy mappings for the given temporary table.
|
(package private) static void |
removePermanentSchema(java.lang.String schema)
Remove the mappings for the specified schema.
|
(package private) abstract void |
removeTable(K key)
Remove the mappings for the specified key.
|
(package private) static void |
removeTemporaryTable(TempTable table)
Remove the mappings for the given temporary table.
|
static void |
setFieldLabelQuirk(RecordBuffer recBuf,
java.lang.String property)
Trigger quirk which takes place when an unknown value is assigned to LABEL attribute of a
buffer field.
|
static void |
setLegacyFieldColumnLabel(RecordBuffer recBuf,
java.lang.String property,
java.lang.String columnLabel)
Set the COLUMN-LABEL field attribute for the property associated with the DMO referenced
by the given buffer.
|
static void |
setLegacyFieldFormat(RecordBuffer recBuf,
java.lang.String property,
java.lang.String format)
Set the FORMAT field attribute for the property associated with the DMO referenced by the
given buffer.
|
static void |
setLegacyFieldHelp(RecordBuffer recBuf,
java.lang.String property,
java.lang.String help)
Set the HELP field attribute for the property associated with the DMO referenced by the
given buffer.
|
static void |
setLegacyFieldLabel(RecordBuffer recBuf,
java.lang.String property,
java.lang.String label)
Set the LABEL field attribute for the property associated with the DMO referenced
by the given buffer.
|
static void |
setLegacyFieldLiteralQuestion(RecordBuffer recBuf,
java.lang.String property,
logical literalQuestion)
Set the LITERAL-QUESTION field attribute for the property associated with the DMO
referenced by the given buffer.
|
static void |
setLegacyFieldValidateExpression(RecordBuffer recBuf,
java.lang.String property,
java.lang.String validateExpression)
Set the VALIDATE-EXPRESSION field attribute for the property associated with the DMO
referenced by the given buffer.
|
static void |
setLegacyFieldValidateMessage(RecordBuffer recBuf,
java.lang.String property,
java.lang.String validateMessage)
Set the VALIDATE-MESSAGE field attribute for the property associated with the DMO
referenced by the given buffer.
|
private static final java.util.Map<java.lang.String,TableMapper.PermanentTableMapper> permanentDBs
private static final ContextLocal<TableMapper.TempTableMapper> staticTempDB
private static final ContextLocal<TableMapper.TempTableMapper> dynamicDB
private static final ContextLocal<java.util.Map<java.lang.Class<?>,java.util.Set<java.lang.String>>> contextLabelQuirks
private final java.lang.String schema
private TableMapper(java.lang.String schema)
schema
- The schema name.public static java.lang.String getDenormalizedProperty(RecordBuffer recBuf, java.lang.String property, java.lang.Integer index)
recBuf
- The DMO interface for a permanent DMO.property
- The DMO property name.index
- zero-based index of this property in denormalization hints or null.public static java.lang.String getLegacyName(RecordBuffer recBuf)
buf.dmoInfo
:
DmoMeta
is shared among multiple DMOs;
recBuf
- A record buffer instance.public static java.lang.String getLegacyFieldColumnLabel(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static void setLegacyFieldColumnLabel(RecordBuffer recBuf, java.lang.String property, java.lang.String columnLabel)
recBuf
- A buffer instance.property
- The DMO property name.columnLabel
- COLUMN-LABEL field attribute.public static java.lang.String getLegacyFieldLabel(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static void setLegacyFieldLabel(RecordBuffer recBuf, java.lang.String property, java.lang.String label)
recBuf
- A buffer instance.property
- The DMO property name.label
- LABEL field attribute.public static void setFieldLabelQuirk(RecordBuffer recBuf, java.lang.String property)
recBuf
- Buffer which has triggered the quirk.property
- Property name of the field for which the quirk has triggered.public static integer getLegacyFieldId(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.public static logical getLegacyFieldLiteralQuestion(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static void setLegacyFieldLiteralQuestion(RecordBuffer recBuf, java.lang.String property, logical literalQuestion)
recBuf
- A buffer instance.property
- The DMO property name.literalQuestion
- LITERAL-QUESTION field attribute.public static logical isLegacyFieldMandatory(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static int getLegacyFieldPosition(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.public static java.lang.String getLegacyFieldValidateExpression(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static void setLegacyFieldValidateExpression(RecordBuffer recBuf, java.lang.String property, java.lang.String validateExpression)
recBuf
- A buffer instance.property
- The DMO property name.validateExpression
- VALIDATE-EXPRESSION field attribute.public static java.lang.String getLegacyFieldValidateMessage(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static void setLegacyFieldValidateMessage(RecordBuffer recBuf, java.lang.String property, java.lang.String validateMessage)
recBuf
- A buffer instance.property
- The DMO property name.validateMessage
- VALIDATE-MESSAGE field attribute.public static java.lang.String getLegacyFieldFormat(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static int getLegacyFieldDecimals(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static void setLegacyFieldFormat(RecordBuffer recBuf, java.lang.String property, java.lang.String format)
recBuf
- A buffer instance.property
- The DMO property name.format
- FORMAT field attribute.public static java.lang.String getLegacyFieldHelp(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static void setLegacyFieldHelp(RecordBuffer recBuf, java.lang.String property, java.lang.String help)
recBuf
- A buffer instance.property
- The DMO property name.help
- HELP field attribute.public static java.lang.String getLegacyFieldInitial(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static java.lang.String getLegacyFieldName(RecordBuffer recBuf, java.lang.String property)
recBuf
- A buffer instance.property
- The DMO property name.null
if there is no such field.public static java.lang.String getLegacyIndexInfo(TempTable tt)
tt
- The buffer instance.public static java.lang.String getLegacyIndexInfoString(RecordBuffer recBuf, int indexNum)
recBuf
- A buffer instance which specifies the DMO class associated with the target index.indexNum
- 0-based index number in the index definition order.null
if there is no index
with the given number. Format of the string is described in
IndexInformation.indexInformation(int)
.public static java.lang.String getLegacyIndexName(RecordBuffer recBuf, java.lang.String idx)
recBuf
- A buffer instance.idx
- The converted index name.null
if there is no such index defined.public static java.util.List<TableMapper.LegacyFieldInfo> getLegacyOrderedList(Buffer buffer, boolean noHidden)
buffer
- The buffer for which the field info is needed. This can be either a
temp-table or a permanent table.noHidden
- If true
do not include the hidden BEFORE-BUFFER specific fields.public static java.lang.String getLegacySchemaName(java.lang.Class<? extends DataModelObject> dmoIface)
dmoIface
- The DMO interface for a permanent DMO.public static boolean hasValidation(java.lang.Class<? extends DataModelObject> dmoIface)
dmoIface
- The DMO interface for a permanent DMO which defines the target table.true
if the table has table-level delete validation.java.lang.IllegalStateException
- If a DMO belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
temp schema
is passed as a parameter.public static java.lang.String getLegacyFieldName(java.lang.Class<? extends DataModelObject> dmoIface, java.lang.String property)
dmoIface
- The DMO interface for a permanent DMO.property
- The DMO property name.null
if there is no such field.java.lang.IllegalStateException
- If a DMO belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
temp schema
is passed as a parameter; for these cases, getLegacyFieldName(TempTable,
String)
or getLegacyFieldName(RecordBuffer, String)
must be used.public static java.lang.String getExtent4GLName(java.lang.Class<? extends DataModelObject> dmoIface, java.lang.String property)
dmoIface
- The DMO interface for a permanent DMO.property
- The DMO property namepublic static TableMapper.LegacyFieldInfo getLegacyFieldInfo(DmoMeta dmoInfo, java.lang.String property)
dmoInfo
- The DMO interface for a permanent DMO.property
- The DMO property name.null
if a table belonging to
the DatabaseManager.TEMP_TABLE_SCHEMA
is used or there is no such field.public static java.util.List<java.lang.String> getLegacyProperties(java.lang.Class<? extends DataModelObject> dmoIface)
dmoIface
- The DMO interface for a permanent DMO.DatabaseManager.TEMP_TABLE_SCHEMA
or empty list if it is not.public static java.lang.String getLegacyIndexName(java.lang.Class<? extends DataModelObject> dmoIface, java.lang.String idx)
dmoIface
- The DMO interface for a permanent DMO.idx
- The converted index name.null
if there is no such index defined.java.lang.IllegalStateException
- If a DMO belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
temp schema
is passed as a parameter; for these cases, getLegacyFieldName(TempTable,
String)
or getLegacyFieldName(RecordBuffer, String)
must be used.public static java.lang.String getLegacyFieldName(TempTable tt, java.lang.String property)
TempTable
resource and property.tt
- The TempTable
resource.property
- The DMO property name.null
if there is no such field.public static java.util.List<TableMapper.LegacyFieldInfo> getAllLegacyFieldInfo(TempTable tt)
TableMapper.LegacyFieldInfo
items for the given
temp-table. The items are sorted by field id (i.e., legacy schema order).tt
- Temp-table for which to retrieve field information.public static TableMapper.LegacyFieldInfo getLegacyFieldInfo(TempTable tt, java.lang.String property)
TempTable
resource and property.tt
- The TempTable
resource.property
- The DMO property name.null
if there is no such field.public static java.lang.String getLegacyIndexName(TempTable tt, java.lang.String idx)
TempTable
resource and converted index name.tt
- The TempTable
resource.idx
- The converted index name.null
if there is no such index defined.public static java.lang.String getPropertyName(TempTable table, java.lang.String field)
TempTable
resource.table
- The TempTable
resource.field
- The legacy field name (not mandatory normalized).null
if
there is no such field.public static java.lang.String getPropertyName(TempTable table, java.lang.String field, java.lang.Integer index)
TempTable
resource.table
- The TempTable
resource.field
- The legacy field name (not mandatory normalized).index
- null
for usual properties and zero-based index of this property for
denormalized field with extent.null
if
there is no such field.public static java.lang.String getPropertyName(TempTable table, int fieldId)
TempTable
resource.table
- The TempTable
resource.fieldId
- The field index in table declaring sequence.null
if
there is no such field.public static java.lang.String getPropertyName(TempTable table, int fieldId, java.lang.Integer index)
TempTable
resource.table
- The TempTable
resource.fieldId
- The field index in table declaring sequence.index
- null
for usual properties and zero-based index of this property for
denormalized field with extent.null
if
there is no such field.public static int getNumFields(TempTable table)
TempTable
resource.table
- The TempTable
resource.null
if
there is no such field.public static java.lang.String getIndexName(TempTable table, java.lang.String idx)
TempTable
resource.table
- The TempTable
resource.idx
- The legacy index name.null
if there is no such index.public static java.lang.Class<? extends Record> getDMOClass(java.lang.String schema, java.lang.String table)
schema
- The schema name.table
- The legacy table name.null
if there is no table with the
given name.java.lang.IllegalArgumentException
- If a table belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
is used.public static java.lang.String getPropertyName(java.lang.String schema, java.lang.String table, java.lang.String field)
schema
- The schema name.table
- The legacy table name.field
- The legacy field name (not mandatory normalized).null
if
there is no such field.java.lang.IllegalArgumentException
- If a table belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
is used.public static java.lang.String getPropertyName(java.lang.String schema, java.lang.String table, java.lang.String field, java.lang.Integer index)
schema
- The schema name.table
- The legacy table name.field
- The legacy field name (not mandatory normalized).index
- null
for usual properties and zero-based index of this property for
denormalized field with extent.null
if
there is no such field.java.lang.IllegalArgumentException
- If a table belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
is used.public static java.lang.String getPropertyName(java.lang.String schema, java.lang.String table, int fieldId)
schema
- The schema name.table
- The legacy table name.fieldId
- The field index.null
if
there is no such field.java.lang.IllegalArgumentException
- If a table belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
is used.public static java.lang.String getPropertyName(java.lang.String schema, java.lang.String table, int fieldId, java.lang.Integer index)
schema
- The schema name.table
- The legacy table name.fieldId
- The field index.index
- null
for usual properties and zero-based index of this property for
denormalized field with extent.null
if
there is no such field.java.lang.IllegalArgumentException
- If a table belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
is used.public static int getNumFields(java.lang.String schema, java.lang.String table)
schema
- The schema name.table
- The legacy table name.java.lang.IllegalArgumentException
- If a table belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
is used.public static java.lang.String getPropertyName(java.lang.Class<? extends DataModelObject> dmoIface, int fieldId)
dmoIface
- The DMO interface for a permanent DMO.fieldId
- The field index.null
if
there is no such field.java.lang.IllegalArgumentException
- If a table belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
is used.public static java.lang.String getPropertyName(RecordBuffer recBuff, java.lang.String legacyFieldName)
recBuff
- Buffer which belongs to the target table.legacyFieldName
- Legacy name of the target field.public static java.lang.String getIndexName(java.lang.String schema, java.lang.String table, java.lang.String idx)
schema
- The schema name.table
- The legacy table name.idx
- The legacy index name.null
if there is no such index.java.lang.IllegalArgumentException
- If a table belonging to the DatabaseManager.TEMP_TABLE_SCHEMA
is used.public static void mapPermanentDMO(DmoMeta dmoInfo)
dmoInfo
- Object which contains metadata about the DMO.static void removePermanentSchema(java.lang.String schema)
schema
- The schema name.static void mapTemporaryTable(TempTable table)
table
- The TempTable
resource.static void removeTemporaryTable(TempTable table)
table
- The TempTable
resource to be removed.static java.util.Set<java.lang.String> getCommonFields(RecordBuffer buf1, RecordBuffer buf2)
buf1
- The record buffer which represents the first table.buf2
- The record buffer which represents the second table.static P2JIndex findJoiningIndex(RecordBuffer buffer, java.util.Set<java.lang.String> commonFields) throws PersistenceException
buffer
- The buffer which represents the table to be searched for a suitable index.commonFields
- Map of legacy fields which the given table has in common with another one.commonFields
, or null
if no such
index is found.PersistenceException
static java.util.Set<java.lang.String> getIndexFieldNames(P2JIndex index)
index
- The index whose fields are to be included in the set.static LegacyFieldNameMap getLegacyFieldNameMap(RecordBuffer buffer)
buffer
- Record buffer for which the mapping is needed.public static TableMapper.LegacyFieldInfo getLegacyFieldInfo(RecordBuffer recBuff, java.lang.String property)
recBuff
- A RecordBuffer
instance.property
- The DMO property name.null
if there is no such field.static TableMapper.LegacyIndexInfo getLegacyIndexInfo(RecordBuffer recBuf, int indexNum)
recBuf
- A buffer instance which specifies the DMO class associated with the target index.indexNum
- 0-based index number in the index definition order.null
if there is no index
with the given number. Format of the string is described in
IndexInformation.indexInformation(int)
.public static TableMapper.LegacyIndexInfo getLegacyIndexInfo(TempTable tt, int indexNum)
tt
- Temporary table associated with the target index.indexNum
- 0-based index number in the index definition order.null
if there is no index
with the given number. Format of the string is described in
IndexInformation.indexInformation(int)
.static TableMapper.LegacyIndexInfo getLegacyIndexInfo(java.lang.Class<? extends DataModelObject> dmoIface, int indexNum)
dmoIface
- DMO class associated with the target index.indexNum
- 0-based index number in the index definition order.null
if there is no index
with the given number. Format of the string is described in
IndexInformation.indexInformation(int)
.public static java.lang.String getLegacyTriggerProcedure(java.lang.Class<? extends DataModelObject> dmoIface, java.lang.String event, java.lang.String property)
dmoIface
- DMO class associated with the target trigger.event
- the type of the event for the trigger.null
if there is no trigger
for this kind of event.public static boolean isLegacyTriggerOverrideable(java.lang.Class<? extends DataModelObject> dmoIface, java.lang.String event, java.lang.String property)
dmoIface
- DMO class associated with the target trigger.event
- the type of the event for the trigger.public static TableMapper.LegacyTriggerInfo getLegacyTriggerInfo(java.lang.Class<? extends DataModelObject> dmoIface, java.lang.String event, java.lang.String property)
dmoIface
- DMO class associated with the target index.event
- the type of the event for the trigger.null
if there is no trigger
for this kind of event.private static TableMapper.TempTableMapper locateTemp(TempTable tt)
TableMapper.TempTableMapper
for the given temp-table. If it is statically
defined, return the shared, static version, else return the context-local version for
dynamically defined temp-tables.tt
- Temp-table object.private static TableMapper.PermanentTableMapper locatePerm(java.lang.String schema)
TableMapper.PermanentTableMapper
instance for the given schema.schema
- The schema name.abstract void removeTable(K key)
key
- The key to be removed.java.lang.String getPropertyNameImpl(K legacyKey, int fieldId, java.lang.Integer index)
legacyKey
.legacyKey
- The key used to identify the TableMapper.LegacyTableInfo
.fieldId
- The index of the field in the buffer's sequence.index
- null
for usual properties and zero-based index of this property for
denormalized field with extent.null
if
there is no such field.int getNumFieldsImpl(K legacyKey)
legacyKey
- Key to which the target table is matched.private static java.lang.String extractPropertyName(TableMapper.LegacyTableInfo tableInfo, TableMapper.LegacyFieldInfo fieldInfo, java.lang.Integer index)
tableInfo
- The key used to identify the TableMapper.LegacyTableInfo
.fieldInfo
- The index of the field in the buffer's sequence.index
- null
for usual properties and zero-based index of this property for
denormalized field with extent.java.lang.String getIndexNameImpl(K legacyKey, java.lang.String idx)
legacyKey
.legacyKey
- The key used to identify the TableMapper.LegacyTableInfo
.idx
- The legacy index name.null
if there is no such index.abstract void clear()
public abstract java.lang.String denormalizedProperty(K key, java.lang.String property, java.lang.Integer index)
key
- The key for a permanent DMO.property
- The DMO property name.index
- zero-based index of this property in denormalization hints.java.lang.String getPropertyNameImpl(K legacyKey, java.lang.String field, java.lang.Integer index)
legacyKey
.legacyKey
- The key used to identify the TableMapper.LegacyTableInfo
.field
- The legacy field name (not mandatory normalized).index
- null
for usual properties and zero-based index of this property for
denormalized field with extent.null
if
there is no such field.abstract TableMapper.LegacyTableInfo byKey(K key)
TableMapper.LegacyTableInfo
instance mapped to a specific key
. The type of key
is implementation specific.TableMapper.LegacyTableInfo
instance if one exists.