public class DsTableDefinition
extends java.lang.Object
implements java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
errorString
The ERROR-STRING attribute for this table definition.
|
private java.lang.String |
indexes
A string with all indexes of this table definition encoded as a
String . |
private java.lang.String |
name
The name of this table.
|
private int |
numIndexes
The number of indexes in this table definition.
|
private DsTableDefinition |
peerDef
The peer table.
|
private java.util.List<PropertyDefinition> |
properties
The list of read properties.
|
private TableResultSet |
resultSet
The result set to be sent to the remote side.
|
private java.util.List<java.lang.Object[]> |
rows
The read data.
|
private java.util.List<java.lang.Object[]> |
rowsMeta
The read row metadata.
|
private int |
schemaMarshalLevel
The SCHEMA-MARSHAL level for the serialized temp-table.
|
private int |
tableType
The table BEFORE/AFTER type.
|
private java.lang.String |
xmlNodeName
The XML-NODE-NAME attribute for this table definition.
|
private java.lang.String |
xmlns
The XML namespace for this table definition.
|
private java.lang.String |
xmlPrefix
The XML prefix for this table definition.
|
Constructor and Description |
---|
DsTableDefinition()
Default c'tor, explicitly added to allow instances of this class to be created on
deserialization.
|
DsTableDefinition(BufferImpl target,
boolean copyRows)
The "serialization" constructor.
|
DsTableDefinition(TableResultSet resultSet)
Wrap a custom result set in a class known to P2J, so the remote side can deserialize it.
|
Modifier and Type | Method and Description |
---|---|
void |
clearRows()
Delete row data.
|
java.lang.String |
getErrorString()
Obtain the ERROR-STRING attribute for this table definition.
|
java.lang.String |
getIndexes()
Obtain the set of indexes of this table definition.
|
java.lang.String |
getName()
Gets the name of this table.
|
int |
getNumFields()
Obtain the number of fields in this table.
|
int |
getNumIndexes()
Returns the number of indexes defined for this table.
|
DsTableDefinition |
getPeerDef()
Obtain the peer table definition.
|
java.util.List<PropertyDefinition> |
getProperties()
Get the list of read
properties . |
TableResultSet |
getResultSet()
Obtain the
TableResultSet of this table. |
java.util.List<java.lang.Object[]> |
getRows()
Get the list of read
rows . |
java.util.List<java.lang.Object[]> |
getRowsMeta()
Get the meta info for each row (the
TempRecord fields). |
java.lang.String |
getXmlNodeName()
Obtain the XML node name for this table definition.
|
java.lang.String |
getXmlns()
Obtain the XML namespace for this table definition.
|
java.lang.String |
getXmlPrefix()
Obtain the XML prefix for this table definition.
|
boolean |
isAfterTable()
Check whether this is a definition of an AFTER-TABLE.
|
boolean |
isBeforeTable()
Check whether this is a definition of a BEFORE-TABLE.
|
boolean |
isSimpleTable()
Check whether this is a definition of a SIMPLE temp-table.
|
java.util.Iterator<PropertyDefinition> |
propertyIterator()
Provides an iterator over the read
properties . |
void |
readExternal(java.io.ObjectInput in)
Read the table definition from the specified input source.
|
java.util.Iterator<java.lang.Object[]> |
rowIterator()
Provides an iterator over the read
rows . |
void |
setErrorString(java.lang.String err)
Sets the ERROR-STRING attribute for this table definition.
|
void |
setIndexes(int numIndexes,
java.lang.String indexes)
Configures the index3es for this table.
|
void |
setName(java.lang.String name)
Sets the name of this table.
|
void |
setPeerDef(DsTableDefinition peerDef)
Configures the peer table definition.
|
void |
setXmlNodeName(java.lang.String xmlNodeName)
Sets the XML node name for this table definition.
|
void |
setXmlns(java.lang.String xmlns)
Sets the XML namespace for this table definition.
|
void |
setXmlPrefix(java.lang.String xmlPrefix)
Sets the XML prefix for this table definition.
|
java.lang.String |
toString()
Get a string representation of this table.
|
void |
writeExternal(java.io.ObjectOutput out)
Send the table definition to the specified output destination.
|
private java.lang.String name
private TableResultSet resultSet
private java.util.List<PropertyDefinition> properties
private java.util.List<java.lang.Object[]> rows
private java.util.List<java.lang.Object[]> rowsMeta
private int tableType
private DsTableDefinition peerDef
private int numIndexes
private java.lang.String xmlns
private java.lang.String xmlPrefix
private java.lang.String xmlNodeName
private java.lang.String errorString
private java.lang.String indexes
String
.
See multiIxCols syntax on
https://documentation.progress.com/output/ua/OpenEdge_latest/dvjav/Constructor_2.htmlprivate final int schemaMarshalLevel
SM_DEFAULT
when object is to
be serialized. Always SM_DEFAULT
for a read object.public DsTableDefinition()
public DsTableDefinition(TableResultSet resultSet)
resultSet
- The result set, which is a subclass of TableResultSet
.public DsTableDefinition(BufferImpl target, boolean copyRows)
BufferImpl
and prepare for serialization.
If it belongs to an AFTER-TABLE, the associated BEFORE-TABLE will also be serialized.target
- The BufferImpl
to be serialized.copyRows
- true
> to transfer rows in INPUT direction. false
> to transfer only
table definitions.public DsTableDefinition getPeerDef()
Usage of this method is not encouraged. This is because the caller is not aware of what
exactly he will receive and the method logic does not have the means to check whether the
returned object is exactly what was desired. Specialized method should be used (namely
getBeforeDef()
and getAfterDef()
).
DsTableDefinition
as explained above.public void setPeerDef(DsTableDefinition peerDef)
Usage of this method is not encouraged. This is because the caller is not aware of what
exactly he will set and the method logic does not have the means to check whether the
returned object is exactly what was desired. Specialized method should be used (namely
setBeforeDef()
and setAfterDef()
). Moreover, the method automatically sets
this as an AFTER-BUFFER definition.
peerDef
- The new peer table definition.public java.lang.String getName()
public void setName(java.lang.String name)
name
- The (new) name of this table.public boolean isAfterTable()
true
if this is an AFTER-TABLE definition.public boolean isBeforeTable()
true
if this is an BEFORE-TABLE definition.public boolean isSimpleTable()
true
if this is an SIMPLE temp-table definition.public int getNumFields()
NOTE: the result of this method is valid only after properties
was set.
TODO: test and confirm whether this method returns the number of legacy fields or this number includes the meta-fields (ROW-STATE, BEFORE-ROWID, etc)
public int getNumIndexes()
public java.lang.String getXmlns()
public java.lang.String getXmlPrefix()
public java.lang.String getXmlNodeName()
public java.lang.String getErrorString()
public java.lang.String getIndexes()
indexes
public void setXmlns(java.lang.String xmlns)
xmlns
- The (new) XML namespace for this table definition.public void setXmlPrefix(java.lang.String xmlPrefix)
xmlPrefix
- XML prefix for this table definition.public void setXmlNodeName(java.lang.String xmlNodeName)
xmlNodeName
- XML prefix for this table definition.public void setErrorString(java.lang.String err)
err
- ERROR-STRING attribute for this table definition.public void setIndexes(int numIndexes, java.lang.String indexes)
numIndexes
- The number of indexes in this table definition.indexes
- A string with all indexes of this table definition encoded as a String
.public java.util.Iterator<PropertyDefinition> propertyIterator()
properties
. This is used to access the data
sent by a remote side, via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public java.util.Iterator<java.lang.Object[]> rowIterator()
rows
. This is used to access the data sent by a
remote side, via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public java.util.List<PropertyDefinition> getProperties()
properties
. This is used to access the data sent by a remote
side, via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public java.util.List<java.lang.Object[]> getRows()
rows
. This is used to access the data sent by a remote side,
via readExternal(java.io.ObjectInput)
. Must not be called when resultSet
is set.public java.util.List<java.lang.Object[]> getRowsMeta()
TempRecord
fields).TempTableRecord.toArray()
public TableResultSet getResultSet()
TableResultSet
of this table.TableResultSet
of this table.public final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which the table definition will be sent.java.io.IOException
- In case of I/O errors.public final void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The input source from which the table definition will be read.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If the read type
of a property can't be resolved to a valid class.public void clearRows()
public java.lang.String toString()
toString
in class java.lang.Object