class DataSetSDOHelper
extends java.lang.Object
The DataSet is constructed as a DataGraph, for which
the metadata has the following structure (each graph node is a DataObject):
graph type, with two properties:
scope, which holds the HelperContext used to build the metadata.
metadata, having the custom graphmetadata type.graphmetadata defines the details about the tables and relations, in these properties:
scope, which helps the HelperContext used to build the metadataname, a String with the DataSet namexmlns, a String with the XML namespace.xmlPrefix, a String with the XML prefix.xmlNodeName, a String with the XML node name.idSequence, the internal record ID sequencetables, a list of tablemetadata holding the defined tablesrelations, a list of LegacyRelationMetaData holding the defined relationstablemetadata defines the details about a table:
idx, an int with the table index in the datagraph's table list.name, a String with the legacy table name.numFields, an int with the number of defined fields.b4img, a boolean flag identifying if a table as a BEFORE-IMAGE.numIndexes, an int identifying the number of defined indexes.indexes, a String with the index definitions.xmlns, a String with the XML namespace.xmlPrefix, a String with the XML prefix.xmlNodeName, a String with the XML node name.errorString, a String with the table's ERROR-STRING attribute value.tabletype, a Type defining this table (used to add rows to the table). This
type MUST extend the baserowtype, so that the rows know their container.
fields, a list with the field definitions, of LegacyFieldMetaData type.rows, a list with the table's rows (they have as type a custom type
build based on the table'sfields. The base type is
baserowtype, an empty type.
beforeRows, a list with the before-table's rows, with the same record
type as the rows list. These are created/managed only when logging is enabled.
normalizedExtent, flag indicating if the extent fields are kept in a single field
(normalized, as for Java clients) or denormalized, with individual fields for each index (as for
.NET clients).
LegacyRelationMetaData defines the details about a relation:
name, a String with the relation name.parentBuffer, a String with the name of the parent table.childBuffer, a String with the name of the child table.whereString, a String with the WHERE clause of this relation.active, a Boolean with the relation's active state.parentId, a Boolean with the parent-id state.pairs, a String with parent, child field pairs, comma delimited.fkeyHidden, a Boolean with the FOREIGN-KEY-HIDDEN status.recursive, a Boolean with the recursive status.nested, a Boolean with the NESTED status.reposition, a Boolean with Rthe REPOSITION status.LegacyFieldMetaData defines the details about a field:
idx, an int with the field's position in the table's fieldsname, a String with the legacy field name; indexed for denormalized extent.extent, an int with the field's extent.extentIndex, an int with the extent field's index, for denormalized extent.extentField, the legacy name of the extent field (non-indexed).type, a BaseDataType class with the field's type.legacytype, an int with the field's type, as specified by
LegacyJavaAppserver constants.order, an int with the fields order.xmlMapping, a int with the XML name describing this field.LegacyJavaAppserver.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DENORMALIZED_PREFIX
A prefix added to denormalized extent fields.
|
private static java.lang.String |
FWD_TABLE_TYPE_SUFFIX
The suffix for a table row.
|
static java.lang.String |
FWD_URI
The URI for the custom types.
|
private static CentralLogger |
LOG
Logger
|
private static boolean |
mergeTables
Flag indicating the response will be merged, instead of being replaced in the dataset.
|
static java.lang.String |
SDO_API_URI
The URI for defining known types (as int, String, etc).
|
private static boolean |
unknownValuesForFields
Flag indicating any unset field will return null, instead of its default value (like 0 and false for
Java native types).
|
| Constructor and Description |
|---|
DataSetSDOHelper() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
addBeforeObject(commonj.sdo.DataGraph graph,
commonj.sdo.DataObject row)
Add a new before-table row.
|
static void |
addDataObject(commonj.sdo.DataGraph graph,
commonj.sdo.DataObject row)
Add the specified row to the graph.
|
static void |
addDataObject(commonj.sdo.DataObject tableMetaData,
commonj.sdo.DataObject row)
Add the specified row to the graph.
|
protected static commonj.sdo.DataObject |
addPropertyDescription(commonj.sdo.DataObject containerType,
java.lang.Object propertyType,
java.lang.String propertyName)
Create a new property for the specified type.
|
static void |
addRelation(commonj.sdo.DataObject metaData,
java.lang.String name,
java.lang.String parentBuffer,
java.lang.String childBuffer,
java.lang.String whereString,
boolean active,
boolean parentId,
java.lang.String pairs,
boolean fkeyHidden,
boolean recursive,
boolean nested,
boolean reposition)
Add a relation to the graph's metadata.
|
static void |
addTableMetaData(commonj.sdo.DataObject metaData,
commonj.sdo.DataObject table)
Add the specified table metadata to the graph.
|
static void |
beginLogging(commonj.sdo.DataGraph graph)
Begin the logging for changes in this graph.
|
(package private) static java.lang.String |
buildDenormalizedFieldName(java.lang.String fname,
int idx)
Compute the denormalized field name.
|
static void |
clearAllRows(commonj.sdo.DataObject metadata)
Clear the rows in the entire dataset.
|
private static void |
createBeforeRow(FWDDataObjectType record,
int state)
Create a before-table row with the specified state.
|
static commonj.sdo.DataGraph |
createDataGraph()
Create a new graph to hold a dataset.
|
static commonj.sdo.DataGraph |
createDataGraph(commonj.sdo.DataObject metadata)
Create a new metadata object to hold the table details.
|
static commonj.sdo.DataObject |
createDataObject(commonj.sdo.DataGraph graph,
java.lang.String table)
Create a new row for the specified table.
|
static commonj.sdo.DataObject |
createDataObject(commonj.sdo.DataObject tableMetaData)
Create a new row for the specified table.
|
static commonj.sdo.DataObject |
createGraphMetaData(commonj.sdo.DataObject ori)
Create a metadata object identical with the given metadata (except tables).
|
static commonj.sdo.DataObject |
createGraphMetaData(java.lang.String name)
Create a metadata object with the specified name.
|
static commonj.sdo.DataObject |
createGraphMetaData(java.lang.String name,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName)
Create a metadata object with the specified details.
|
static void |
createGraphMetaDataTypes(commonj.sdo.helper.HelperContext scope)
Create the metadata types.
|
private static commonj.sdo.helper.HelperContext |
createHelperContext()
Create a new
HelperContext instance. |
static commonj.sdo.DataObject |
createTableMetaData(java.lang.String name,
int numFields,
boolean b4img,
int numIndexes,
java.lang.String indexes,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName,
java.lang.String errorString,
boolean normalizedExtent)
Create an object with a table metadata.
|
protected static commonj.sdo.DataObject |
createTypeDescription(commonj.sdo.helper.HelperContext scope,
java.lang.String uri,
java.lang.String name)
Create a new type description.
|
static void |
endLogging(commonj.sdo.DataGraph graph)
End the logging for changes in this graph.
|
static java.util.List<commonj.sdo.DataObject> |
getBeforeObjects(commonj.sdo.DataGraph graph,
java.lang.String name)
Get the before-table rows for the specified after-table.
|
static java.util.List<commonj.sdo.DataObject> |
getBeforeObjects(commonj.sdo.DataObject table)
Get the before-table rows for this after-table.
|
static java.util.List<commonj.sdo.DataObject> |
getChildRows(commonj.sdo.DataObject row,
java.lang.String relation)
Get the child rows for this record.
|
static java.lang.String |
getDataGraphName(commonj.sdo.DataObject metadata)
Get the graph name from the specified metadata, of type
graphmetadata. |
static java.util.List<commonj.sdo.DataObject> |
getDataObjects(commonj.sdo.DataGraph graph,
int idx)
Get all the records for the table on the specified index, in the graph metadata.
|
static java.util.List<commonj.sdo.DataObject> |
getDataObjects(commonj.sdo.DataGraph graph,
java.lang.String name)
Get all the records for the table with the given name, in the graph metadata.
|
static java.util.List<commonj.sdo.DataObject> |
getDataObjects(commonj.sdo.DataObject table)
Get all the records for this table.
|
static java.util.List<commonj.sdo.DataObject> |
getDataObjects(commonj.sdo.DataObject graphMeta,
java.lang.String name)
Get all the records for the table with the given name, in the graph metadata.
|
static int |
getFieldCount(commonj.sdo.DataObject row)
Get the number of fields for a given row.
|
private static java.lang.String |
getFieldListKey(java.util.List<LegacyFieldMetaData> fields)
Get the key associated with a field list.
|
static java.util.List<LegacyFieldMetaData> |
getFieldMetaData(commonj.sdo.DataObject tableMeta)
Get the metadata for all fields in the specified table.
|
static LegacyFieldMetaData |
getFieldMetaData(commonj.sdo.DataObject tableMeta,
java.lang.String fname,
boolean forceNormalizedFields)
Get the field metadata for the specified property.
|
static LegacyFieldMetaData |
getFieldMetaData(commonj.sdo.DataObject tableMeta,
java.lang.String fname,
boolean forceNormalizedFields,
boolean failNotFound)
Get the field metadata for the specified property.
|
static java.lang.String |
getFieldName(commonj.sdo.DataObject row,
int i)
Get the name of the field on the given index in the metadata.
|
static int |
getFieldType(commonj.sdo.DataObject row,
int i)
Get the type of the field on the given index in the metadata.
|
static java.lang.String |
getGraphName(commonj.sdo.DataObject tableMetadata)
Get the data graph name for the given table metadata.
|
static commonj.sdo.DataObject |
getMetaData(commonj.sdo.DataGraph graph)
Get the metadata object for this graph, from the
metadata property of the root
object. |
private static long |
getNextId(commonj.sdo.DataGraph graph)
Get next internal record ID for this graph.
|
private static long |
getNextId(commonj.sdo.DataObject graphMeta)
Get next internal record ID for this graph.
|
static int |
getNumTables(commonj.sdo.DataObject metadata)
Get the number of tables for a graph metadata.
|
static LegacyRelationMetaData |
getRelation(commonj.sdo.DataGraph graph,
java.lang.String name)
Get the relation metadata with the given name.
|
static LegacyRelationMetaData |
getRelation(commonj.sdo.DataObject metaData,
java.lang.String name)
Get the relation metadata with the given name.
|
static LegacyRelationMetaData[] |
getRelations(commonj.sdo.DataGraph graph)
Get the all relation metadata from the given graph.
|
static LegacyRelationMetaData[] |
getRelations(commonj.sdo.DataObject metaData)
Get the all relation metadata from the given graph.
|
static int |
getTableFieldCount(commonj.sdo.DataObject tableMeta)
Get the number of fields for the specified table meta.
|
static java.lang.String[] |
getTableFieldNames(commonj.sdo.DataObject tableMeta)
Get the field names for the specified table meta.
|
static int |
getTableFieldType(commonj.sdo.DataObject tableMetadata,
int fieldIndex)
Get the field type.
|
static int |
getTableFieldType(commonj.sdo.DataObject tableMetadata,
java.lang.String fieldName)
Get the field type.
|
static int |
getTableIndex(commonj.sdo.DataGraph graph,
java.lang.String name)
Get the table index for a given table name and data graph.
|
static int |
getTableIndex(commonj.sdo.DataObject value)
Get the table index for a given row or table metadata.
|
static int |
getTableIndex(commonj.sdo.DataObject metadata,
java.lang.String name)
Get the table index for a given table name and data graph metadata.
|
static java.util.List<commonj.sdo.DataObject> |
getTableMetaData(commonj.sdo.DataGraph graph)
Get the metadata list for all tables.
|
static commonj.sdo.DataObject |
getTableMetaData(commonj.sdo.DataGraph graph,
java.lang.String table)
Get the metadata for the specified table.
|
static commonj.sdo.DataObject |
getTableMetaData(commonj.sdo.DataObject metaData,
int i)
Get the metadata for the table registered on the given index in the graph.
|
static commonj.sdo.DataObject |
getTableMetaData(commonj.sdo.DataObject metaData,
java.lang.String name)
Get the metadata for the table registered with the given name in the graph.
|
static java.lang.String |
getTableName(commonj.sdo.DataObject value)
Get the table name for a given row or table metadata.
|
static java.lang.String[] |
getTableNames(commonj.sdo.DataGraph graph)
Get all table names from the given graph.
|
static java.lang.String[] |
getTableNames(commonj.sdo.DataObject metadata)
Get all table names from the given graph metadata.
|
static void |
initGraphMetaData(commonj.sdo.DataObject metadata,
java.lang.String name,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName,
java.util.List<java.lang.String> tableNames)
Initialize this graph metadata.
|
static java.util.Map<java.lang.String,java.lang.String> |
initGraphMetaData(commonj.sdo.DataObject metadata,
java.lang.String name,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName,
java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.String>>> tableSignatures)
Initialize this graph metadata.
|
static void |
initTableMetaData(commonj.sdo.DataObject tableMeta,
java.lang.String name,
int numFields,
boolean b4img,
int numIndexes,
java.lang.String indexes,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName,
java.lang.String errorString,
boolean normalizedExtent)
Initialize the given table metadata.
|
static boolean |
isMergeTables()
Get the
mergeTables flag. |
static boolean |
isTableField(commonj.sdo.DataObject tableMetadata,
java.lang.String fieldName)
Check if this table has a field defined with that name.
|
static boolean |
isUnknownValuesForFields()
Get the
unknownValuesForFields flag. |
(package private) static void |
logChanged(FWDDataObjectType record)
Mark this record as being changed, in the before-table.
|
(package private) static void |
logCreated(FWDDataObjectType record)
Mark this record as being created, in the before-table.
|
(package private) static void |
logDeleted(FWDDataObjectType record)
Mark this record as being deleted, in the before-table.
|
static void |
main(java.lang.String[] args)
A simple test for the Tuscany SDO APIs.
|
static java.util.List<commonj.sdo.DataObject> |
selectRows(commonj.sdo.DataObject tableMetadata,
java.lang.String[] fields,
java.lang.Object[] values)
Retrieve all rows which have an exact match for the specified fields.
|
static void |
setBeforeRows(commonj.sdo.DataGraph graph,
java.lang.String tableName,
java.util.List<commonj.sdo.DataObject> rows)
Set the before-table rows for the specified table.
|
static LegacyFieldMetaData |
setFieldMetaData(commonj.sdo.DataObject metaData,
int idx,
java.lang.String name,
int extent,
java.lang.Class<?> cls,
int legacyType,
int order,
int xmlMapping)
Add a new new field with the specified configuration.
|
static LegacyFieldMetaData |
setFieldMetaData(java.util.List<LegacyFieldMetaData> fields,
commonj.sdo.DataObject metaData,
LegacyFieldMetaData field)
Add a new new field with the specified configuration.
|
static void |
setGraphMetaData(commonj.sdo.DataGraph graph,
commonj.sdo.DataObject metadata)
Set the metadata to the specified graph.
|
static void |
setMergeTables(boolean state)
Set the
mergeTables flag. |
static void |
setTableRows(commonj.sdo.DataGraph graph,
java.lang.String tableName,
java.util.List<commonj.sdo.DataObject> rows)
Set the table rows for the specified table.
|
static void |
setUnknownValuesForFields(boolean state)
Set the
unknownValuesForFields flag. |
private static java.lang.String |
tableFromType(commonj.sdo.Type type)
Compute the table name from the custom type of the table's records.
|
private static java.lang.String |
tableTypeName(java.lang.String table,
java.util.List<LegacyFieldMetaData> fields)
Construct the custom type to hold records for this table.
|
public static final java.lang.String FWD_URI
public static final java.lang.String SDO_API_URI
public static final java.lang.String DENORMALIZED_PREFIX
private static final java.lang.String FWD_TABLE_TYPE_SUFFIX
private static final CentralLogger LOG
private static volatile boolean unknownValuesForFields
private static volatile boolean mergeTables
public static void setUnknownValuesForFields(boolean state)
unknownValuesForFields flag.state - true to return null if the field is not set.public static boolean isUnknownValuesForFields()
unknownValuesForFields flag.public static void setMergeTables(boolean state)
mergeTables flag.state - true to merge the response.public static boolean isMergeTables()
mergeTables flag.public static void beginLogging(commonj.sdo.DataGraph graph)
graph - The graph to track changes.public static void endLogging(commonj.sdo.DataGraph graph)
graph - The graph to track changes.public static java.lang.String getDataGraphName(commonj.sdo.DataObject metadata)
graphmetadata.metadata - The metadata.public static commonj.sdo.DataObject getMetaData(commonj.sdo.DataGraph graph)
metadata property of the root
object.graph - The graph.public static LegacyFieldMetaData setFieldMetaData(java.util.List<LegacyFieldMetaData> fields, commonj.sdo.DataObject metaData, LegacyFieldMetaData field)
fields - The table's fields list, as retrieved from the DataObject.metaData - The table metadata, of type tablemetadata. The field will be added
to the fields property.field - The field meta.public static LegacyFieldMetaData setFieldMetaData(commonj.sdo.DataObject metaData, int idx, java.lang.String name, int extent, java.lang.Class<?> cls, int legacyType, int order, int xmlMapping)
metaData - The table metadata, of type tablemetadata. The field will be added
to the fields property.idx - The field's index in the metadata.name - The field's name.extent - The field's extent.cls - The fields BaseDataType class.legacyType - The legacy type (numeric value based on LegacyJavaAppserver constants.order - The field's order.xmlMapping - The field's mapping.public static LegacyRelationMetaData getRelation(commonj.sdo.DataGraph graph, java.lang.String name)
graph - The data graph.name - The relation name.null if it does not exist.public static LegacyRelationMetaData getRelation(commonj.sdo.DataObject metaData, java.lang.String name)
metaData - The graph metadata.name - The relation name.null if it does not exist.public static LegacyRelationMetaData[] getRelations(commonj.sdo.DataGraph graph)
graph - The data graph.public static LegacyRelationMetaData[] getRelations(commonj.sdo.DataObject metaData)
metaData - The graph metadata.public static void addRelation(commonj.sdo.DataObject metaData,
java.lang.String name,
java.lang.String parentBuffer,
java.lang.String childBuffer,
java.lang.String whereString,
boolean active,
boolean parentId,
java.lang.String pairs,
boolean fkeyHidden,
boolean recursive,
boolean nested,
boolean reposition)
metaData - The graph metadata.name - The relation name.parentBuffer - The parent buffer.childBuffer - The child buffer.whereString - The where string.active - Flag indicating if this relation is active.parentId - Flag indicating if parent-id is used.pairs - The field pairs, in parent, child format.fkeyHidden - Flag indicating if fkey-hidden is used.recursive - Flag indicating if recursive is used.nested - Flag indicating if nested is used.reposition - Flag indicating if reposition is used.public static commonj.sdo.DataObject createTableMetaData(java.lang.String name,
int numFields,
boolean b4img,
int numIndexes,
java.lang.String indexes,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName,
java.lang.String errorString,
boolean normalizedExtent)
tablemetadata type and is not
attached to the graph.name - The table's name.numFields - The number of fields.b4img - Flag indicating if the table has a BEFORE-IMAGE.numIndexes - The number of indexes.indexes - The index specification (TODO: not validated/implemented at this time).xmlns - The XML namespace (TODO: not validated/implemented at this time).xmlPrefix - The XML prefix (TODO: not validated/implemented at this time).xmlNodeName - The XML node name (TODO: not validated/implemented at this time).errorString - The table's ERROR-STRING attribute (TODO: not validated/implemented at this time).normalizedExtent - Flag indicating if the extents are normalized or individual fields will be created for each
index.public static void initTableMetaData(commonj.sdo.DataObject tableMeta,
java.lang.String name,
int numFields,
boolean b4img,
int numIndexes,
java.lang.String indexes,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName,
java.lang.String errorString,
boolean normalizedExtent)
tableMeta - The table's metadata object.name - The table's name.numFields - The number of fields.b4img - Flag indicating if the table has a BEFORE-IMAGE.numIndexes - The number of indexes.indexes - The index specification (TODO: not validated/implemented at this time).xmlns - The XML namespace (TODO: not validated/implemented at this time).xmlPrefix - The XML prefix (TODO: not validated/implemented at this time).xmlNodeName - The XML node name (TODO: not validated/implemented at this time).errorString - The table's ERROR-STRING attribute (TODO: not validated/implemented at this time).normalizedExtent - Flag indicating if the extents are normalized or individual fields will be created for each
index.public static void addTableMetaData(commonj.sdo.DataObject metaData,
commonj.sdo.DataObject table)
metaData - The graph metadata.table - The table metadata.public static java.util.List<LegacyFieldMetaData> getFieldMetaData(commonj.sdo.DataObject tableMeta)
tableMeta - The table metadata.public static LegacyFieldMetaData getFieldMetaData(commonj.sdo.DataObject tableMeta, java.lang.String fname, boolean forceNormalizedFields)
tableMeta - The table metadata.fname - The field name.forceNormalizedFields - When this flag is set, only normalized extent fields are looked.java.lang.IllegalStateException - If the field can't be resolved.public static LegacyFieldMetaData getFieldMetaData(commonj.sdo.DataObject tableMeta, java.lang.String fname, boolean forceNormalizedFields, boolean failNotFound)
tableMeta - The table metadata.fname - The field name.forceNormalizedFields - When this flag is set, only normalized extent fields are looked.failNotFound - Throw an IllegalStateException if the field can't be resolved.java.lang.IllegalStateException - If the field can't be resolved and failNotFound flag is set.public static commonj.sdo.DataObject getTableMetaData(commonj.sdo.DataObject metaData,
int i)
metaData - The graph metadata.i - The table index.public static commonj.sdo.DataObject getTableMetaData(commonj.sdo.DataObject metaData,
java.lang.String name)
metaData - The graph metadata.name - The table name.public static commonj.sdo.DataObject getTableMetaData(commonj.sdo.DataGraph graph,
java.lang.String table)
graph - The graph.table - The table name.null if the table is not part of this graph.public static java.util.List<commonj.sdo.DataObject> getTableMetaData(commonj.sdo.DataGraph graph)
graph - The graph.public static commonj.sdo.DataGraph createDataGraph()
graph node.public static commonj.sdo.DataGraph createDataGraph(commonj.sdo.DataObject metadata)
metadata - The root graph node.public static void setGraphMetaData(commonj.sdo.DataGraph graph,
commonj.sdo.DataObject metadata)
graph - The graph object.metadata - The metadata object which will be set to the graph's metadata
property.public static commonj.sdo.DataObject createGraphMetaData(java.lang.String name)
name - The graph name.setGraphMetaData(commonj.sdo.DataGraph, commonj.sdo.DataObject).public static commonj.sdo.DataObject createGraphMetaData(java.lang.String name,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName)
name - The graph name.xmlns - The namespace URI.xmlPrefix - The namespace prefix.xmlNodeName - The XML node-name.setGraphMetaData(commonj.sdo.DataGraph, commonj.sdo.DataObject).public static void initGraphMetaData(commonj.sdo.DataObject metadata,
java.lang.String name,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName,
java.util.List<java.lang.String> tableNames)
metadata - The graph metadata.name - The graph name.xmlns - The namespace URI.xmlPrefix - The namespace prefix.xmlNodeName - The XML node-name.tableNames - The table names to keep in this metadata. May be null.public static java.util.Map<java.lang.String,java.lang.String> initGraphMetaData(commonj.sdo.DataObject metadata,
java.lang.String name,
java.lang.String xmlns,
java.lang.String xmlPrefix,
java.lang.String xmlNodeName,
java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.String>>> tableSignatures)
metadata - The graph metadata.name - The graph name.xmlns - The namespace URI.xmlPrefix - The namespace prefix.xmlNodeName - The XML node-name.tableSignatures - The table names and signatures to keep in this metadata. May be null.public static commonj.sdo.DataObject createGraphMetaData(commonj.sdo.DataObject ori)
ori - The source metadata.setGraphMetaData(commonj.sdo.DataGraph, commonj.sdo.DataObject).public static void createGraphMetaDataTypes(commonj.sdo.helper.HelperContext scope)
scope - The helper context where the types will be defined.public static void clearAllRows(commonj.sdo.DataObject metadata)
metadata - The metadata for this dataset.public static java.lang.String[] getTableNames(commonj.sdo.DataGraph graph)
graph - The graph.public static java.lang.String[] getTableNames(commonj.sdo.DataObject metadata)
metadata - The graph metadata.public static int getNumTables(commonj.sdo.DataObject metadata)
metadata - The graph metadata.public static java.lang.String getTableName(commonj.sdo.DataObject value)
value - The table row or table metadata.public static int getTableIndex(commonj.sdo.DataObject value)
value - The table row or table metadata.java.lang.NullPointerException - If the row is not attached to a table.public static int getTableIndex(commonj.sdo.DataGraph graph,
java.lang.String name)
graph - The data graph.name - The table name.java.lang.IllegalArgumentException - If the table is not part of this graph.public static int getTableIndex(commonj.sdo.DataObject metadata,
java.lang.String name)
metadata - The graph metadata.name - The table name.java.lang.IllegalArgumentException - If the table is not part of this graph.public static java.lang.String getGraphName(commonj.sdo.DataObject tableMetadata)
tableMetadata - The table metadata.null if the table is not part of a graph.public static int getFieldCount(commonj.sdo.DataObject row)
row - The table row.public static int getTableFieldCount(commonj.sdo.DataObject tableMeta)
tableMeta - The table metadata.public static java.lang.String[] getTableFieldNames(commonj.sdo.DataObject tableMeta)
tableMeta - The table metadata.public static java.lang.String getFieldName(commonj.sdo.DataObject row,
int i)
row - The table row. Must be attached to a table.i - The field index.public static int getFieldType(commonj.sdo.DataObject row,
int i)
row - The table row. Must be attached to a table.i - The field index.public static boolean isTableField(commonj.sdo.DataObject tableMetadata,
java.lang.String fieldName)
tableMetadata - The table metadata.fieldName - The field name.true if there is a field defined with this name.public static int getTableFieldType(commonj.sdo.DataObject tableMetadata,
java.lang.String fieldName)
tableMetadata - The table metadata.fieldName - The field name.public static int getTableFieldType(commonj.sdo.DataObject tableMetadata,
int fieldIndex)
tableMetadata - The table metadata.fieldIndex - The field index.public static commonj.sdo.DataObject createDataObject(commonj.sdo.DataGraph graph,
java.lang.String table)
addDataObject(commonj.sdo.DataGraph, commonj.sdo.DataObject) to add it.graph - The graph.table - The table name.public static commonj.sdo.DataObject createDataObject(commonj.sdo.DataObject tableMetaData)
addDataObject(DataObject, DataObject) to add it.tableMetaData - The table metadata.public static void setTableRows(commonj.sdo.DataGraph graph,
java.lang.String tableName,
java.util.List<commonj.sdo.DataObject> rows)
graph - The graph.tableName - The table name.rows - The list of rows.public static void setBeforeRows(commonj.sdo.DataGraph graph,
java.lang.String tableName,
java.util.List<commonj.sdo.DataObject> rows)
graph - The graph.tableName - The table name.rows - The list of rows.public static void addDataObject(commonj.sdo.DataGraph graph,
commonj.sdo.DataObject row)
graph - The graph.row - The row to add to the table.public static void addDataObject(commonj.sdo.DataObject tableMetaData,
commonj.sdo.DataObject row)
tableMetaData - The table metadata.row - The row to add to the table.public static java.util.List<commonj.sdo.DataObject> getDataObjects(commonj.sdo.DataGraph graph,
int idx)
graph - The graph.idx - The table index.public static java.util.List<commonj.sdo.DataObject> getDataObjects(commonj.sdo.DataObject table)
table - The table metadata.public static java.util.List<commonj.sdo.DataObject> getBeforeObjects(commonj.sdo.DataObject table)
table - The after-table.public static java.util.List<commonj.sdo.DataObject> getDataObjects(commonj.sdo.DataGraph graph,
java.lang.String name)
graph - The graph.name - The table name.public static java.util.List<commonj.sdo.DataObject> getDataObjects(commonj.sdo.DataObject graphMeta,
java.lang.String name)
graphMeta - The graph metadata.name - The table name.public static java.util.List<commonj.sdo.DataObject> getBeforeObjects(commonj.sdo.DataGraph graph,
java.lang.String name)
graph - The graph.name - The table name.public static java.util.List<commonj.sdo.DataObject> selectRows(commonj.sdo.DataObject tableMetadata,
java.lang.String[] fields,
java.lang.Object[] values)
tableMetadata - The table metadata.fields - The field list.values - The values to be matched.public static java.util.List<commonj.sdo.DataObject> getChildRows(commonj.sdo.DataObject row,
java.lang.String relation)
row - The row.relation - The child relation.protected static commonj.sdo.DataObject createTypeDescription(commonj.sdo.helper.HelperContext scope,
java.lang.String uri,
java.lang.String name)
scope - The context.uri - The type URI.name - The type name.protected static commonj.sdo.DataObject addPropertyDescription(commonj.sdo.DataObject containerType,
java.lang.Object propertyType,
java.lang.String propertyName)
containerType - The object type.propertyType - The property type.propertyName - The property name.static java.lang.String buildDenormalizedFieldName(java.lang.String fname,
int idx)
DENORMALIZED_PREFIX and
end with the field's index.fname - The legacy extent field name.idx - The field's index.static void logChanged(FWDDataObjectType record)
record - The changed record.static void logDeleted(FWDDataObjectType record)
record - The delete record.static void logCreated(FWDDataObjectType record)
record - The created record.static void addBeforeObject(commonj.sdo.DataGraph graph,
commonj.sdo.DataObject row)
graph - The graph.row - The row to add.private static void createBeforeRow(FWDDataObjectType record, int state)
record - The after-table row.state - The record state.private static java.lang.String tableTypeName(java.lang.String table,
java.util.List<LegacyFieldMetaData> fields)
table - The table name.fields - The table's fields.private static java.lang.String getFieldListKey(java.util.List<LegacyFieldMetaData> fields)
table name.fields - The field list.private static java.lang.String tableFromType(commonj.sdo.Type type)
type - The table's record type.private static long getNextId(commonj.sdo.DataGraph graph)
graph - The graph.private static long getNextId(commonj.sdo.DataObject graphMeta)
graphMeta - The graph metadata.private static commonj.sdo.helper.HelperContext createHelperContext()
HelperContext instance.public static void main(java.lang.String[] args)