public class DataSource extends HandleChain implements ADMData, DataSourceInterface, DynamicResource, Keyable, QueryAssociable
DataSet object member table,
as well as applying updates back to one or more database tables. There is a distinct
data-source object for each member buffer, which allows a single ProDataSet object and a
single FILL operation on that object to combine data from multiple databases. A data-source
object is defined independently of any DataSet object.| Modifier and Type | Class and Description |
|---|---|
class |
DataSource.Builder
Builder class that helps construct a
DataSource object statically, that is, using
the DEFINE DataSource statement. |
static class |
DataSource.FieldReference
A reference to a field of a buffer.
|
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
_fillWhereString
The current value of
FILL-WHERE-STRING attribute, if set programmatically. |
private java.lang.String |
admData
The value of
ADM-DATA ABL attribute. |
private java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,DataSource.FieldReference>> |
buf2dsrc
The current mapping between the
datasetBuffer and fields from this object. |
private java.util.List<BufferImpl> |
buffers
The list of buffers of this
DataSource. |
private DataSource.Builder |
builder
Temporary builder during the DEFINE process.
|
private BufferImpl |
datasetBuffer
The
Buffer attached to this DataSource. |
private boolean |
deleted
Flag indicating if this resource has been deleted.
|
private boolean |
dynamic
Flags the dynamically constructed objects (using
CREATE as opposed to statically
defined objects, with DEFINE). |
private handle |
hExplicitQuery
The handle to the optional explicit query that defines the buffers for the data-source object.
|
private handle |
hImplicitQuery
The handle to the implicit query that defines the buffers for the data-source object.
|
private boolean |
mergeByField
The current value of the
MERGE-BY-FIELD attribute. |
private java.util.Map<BufferImpl,java.lang.Long> |
nextRowids
The current values of NEXT-ROWID attributes.
|
private boolean |
preferDataset
The current value of the
PREFER-DATASET attribute. |
private long |
restartRow
The current values of RESTART-ROW attribute.
|
private java.util.Map<BufferImpl,java.lang.Long> |
restartRowids
The current values of RESTART-ROWID attributes.
|
private java.util.Map<java.lang.String,java.lang.String> |
revBuf2src
The reversed
buf2dsrc map. |
static java.lang.String |
ROWID_KEY
Marker for added buffers which use their ROWID instead of a field-formed unique key.
|
private java.util.Map<Buffer,java.lang.String[]> |
saveWhereStrings
The values of
SAVE-WHERE-STRING attribute, mapped by their buffers. |
name, nextSibling, prevSibling, wainstProc, pm| Modifier | Constructor and Description |
|---|---|
private |
DataSource(boolean staticDef)
The private constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
_dynamic()
Returns
true if the buffer is dynamic. |
(package private) int |
_getNumSourceBuffers()
Obtain the number of source buffers in this data-source object.
|
logical |
addSourceBuffer(Buffer buf)
Adds a database buffer to a data-source object at run time.
|
logical |
addSourceBuffer(handle hBuf,
java.lang.String keyFields)
Adds a database buffer to a dynamic data-source object at run time.
|
logical |
addSourceBuffer(handle hBuf,
Text keyFields)
Adds a database buffer to a dynamic data-source object at run time.
|
private logical |
addSourceBufferImpl(BufferImpl buffer,
java.lang.String[] keyFields)
Actual implementation of
ADD-SOURCE-BUFFER method. |
(package private) void |
attach(BufferImpl buffer,
java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,DataSource.FieldReference>> buf2dsrc)
Attaches or detaches the dataset buffer to this source (sets the dataset buffer).
|
private java.lang.String |
computeFillWhereString()
Computes the value of
FILL-WHERE-STRING attribute at this moment. |
static void |
create(handle dsHandle)
Factory method.
|
static void |
create(handle dsHandle,
character widgetPool)
Factory method.
|
static void |
create(handle dsHandle,
java.lang.String widgetPool)
Factory method.
|
private boolean |
createImplicitQuery()
Creates and prepares the implicit query.
|
static DataSource.Builder |
define()
Deprecated.
|
static DataSource.Builder |
define(java.lang.String legacyName)
Starts the definition of a new static
DataSource. |
character |
getADMData()
Get the value of the ADM-DATA attribute.
|
handle |
getDatasetBuffer()
Gets the handle to the source buffer attached/associated with this
DataSource. |
character |
getFillWhereString()
Gets the current
WHERE expression for a data-source query, beginning with the
keyword WHERE, and not including the prior FOR EACH phrase of an
OPEN QUERY statement. |
logical |
getMergeByField()
Checks whether the changes on a field-by-field basis will be merged when saving changes from
a
DataSet temp-table buffer to the associated data source using the
SAVE-ROW-CHANGES() method. |
rowid |
getNextRowid()
Gets the
ROWID of the data source row at which the next FILL operation
should start. |
rowid |
getNextRowid(character buffName)
Gets the
ROWID of the data source row at which the next FILL operation
should start. |
rowid |
getNextRowid(long buffNo)
Gets the
ROWID of the data source row at which the next FILL operation
should start. |
rowid |
getNextRowid(NumberType buffNo)
Gets the
ROWID of the data source row at which the next FILL operation
should start. |
rowid |
getNextRowid(java.lang.String buffName)
Gets the
ROWID of the data source row at which the next FILL operation
should start. |
handle |
getNextSibling()
Get the
NEXT-SIBLING attribute of this DataSource. |
integer |
getNumSourceBuffers()
Obtain the number of source buffers in this data-source object.
|
logical |
getPreferDataset()
Checks whether the modifications to the data currently in the data source are ignored when
saving changes from a
DataSet temp-table buffer to the associated data source using
the SAVE-ROW-CHANGES() method. |
handle |
getPrevSibling()
Get the
PREV-SIBLING attribute of this DataSource. |
handle |
getQueryAsHandle()
Get the query associated with the given resource.
|
integer |
getRestartRow()
Gets the current position (absolute row number) for the
FILL query. |
rowid |
getRestartRowid()
Obtain the
ROWID of the data source row at which a FILL operation will
start. |
rowid |
getRestartRowid(long buffNum)
Obtain the
ROWID of the data source row at which a FILL operation will
start. |
rowid |
getRestartRowid(NumberType buffNum)
Obtain the
ROWID of the data source row at which a FILL operation will
start. |
rowid |
getRestartRowid(java.lang.String buffName)
Obtain the
ROWID of the data source row at which a FILL operation will
start. |
rowid |
getRestartRowid(Text buffName)
Obtain the
ROWID of the data source row at which a FILL operation will
start. |
(package private) java.lang.Long[] |
getRestartRowids()
Get the list of
RESTART-ROWID-s for this DataSource. |
character |
getSaveWhereString()
Obtain the
WHERE clause used to find the database buffer identified by the
buffName in a data-source object. |
character |
getSaveWhereString(long buffNum)
Obtain the
WHERE clause used to find the database buffer identified by the
buffName in a data-source object. |
character |
getSaveWhereString(NumberType buffNum)
Obtain the
WHERE clause used to find the database buffer identified by the
buffName in a data-source object. |
character |
getSaveWhereString(java.lang.String buffName)
Obtain the
WHERE clause used to find the database buffer identified by the
buffName in a data-source object. |
character |
getSaveWhereString(Text buffName)
Obtain the
WHERE clause used to find the database buffer identified by the
buffName in a data-source object. |
(package private) java.lang.String |
getSaveWhereStringImpl(Buffer buf,
boolean useBefore)
Get the current value of
SAVE-WHERE-STRING for a specified Buffer. |
handle |
getSourceBuffer()
Gets the handle to the source buffer in the data-source object at the specified index
position.
|
handle |
getSourceBuffer(long bufIndex)
Gets the handle to the source buffer in the data-source object at the specified index
position.
|
handle |
getSourceBuffer(NumberType bufIndex)
Gets the handle to the source buffer in the data-source object at the specified index
position.
|
(package private) int |
getSourceBufferIndex(java.lang.String bufName)
Get a source buffer by its name.
|
BufferImpl |
getSourceBufferNative()
Gets the handle to the source buffer in the data-source object at the specified index
position.
|
BufferImpl |
getSourceBufferNative(long bufIndex)
Gets the handle to the source buffer in the data-source object at the specified index
position.
|
(package private) boolean |
hasExplicitQuery()
Test whether at current moment this data-source has an explicit query configured.
|
protected boolean |
hasNameConstraints()
Allows each resource to declare whether it has some naming constraints.
|
protected boolean |
hasNameReadOnly()
Check if this resource supports the NAME attribute in read-only mode.
|
private boolean |
isAlterable()
Checks whether this object can be altered (added buffers and relations).
|
logical |
isIgnoreCurrentModified()
Checks whether the to ignores modifications to the data currently in the data source when
saving changes from a
DataSet temp-table buffer to the associated data source using
the Buffer.saveRowChanges() method. |
character |
keys()
Obtain the list of key fields of a specified buffer as a comma-separated list.
|
character |
keys(long seqNum)
Obtain the list of key fields of a specified buffer as a comma-separated list.
|
character |
keys(NumberType seqNum)
Obtain the list of key fields of a specified buffer as a comma-separated list.
|
protected boolean |
resourceDelete()
Delete the resource.
|
void |
setADMData(character value)
Set the value of the ADM-DATA attribute.
|
void |
setADMData(java.lang.String value)
Set the value of the ADM-DATA attribute.
|
void |
setFillWhereString(java.lang.String pref)
Sets the current
WHERE expression for a data-source query, beginning with the
keyword WHERE, and not including the prior FOR EACH phrase of an
OPEN QUERY statement. |
void |
setFillWhereString(Text pref)
Sets the current
WHERE expression for a data-source query, beginning with the
keyword WHERE, and not including the prior FOR EACH phrase of an
OPEN QUERY statement. |
void |
setIgnoreCurrentModified(boolean on)
Sets whether the to ignores modifications to the data currently in the data source when
saving changes from a
DataSet temp-table buffer to the associated data source using
the Buffer.saveRowChanges() method. |
void |
setIgnoreCurrentModified(logical on)
Sets whether the to ignores modifications to the data currently in the data source when
saving changes from a
DataSet temp-table buffer to the associated data source using
the Buffer.saveRowChanges() method. |
void |
setMergeByField(boolean merge)
Configures whether the changes on a field-by-field basis will be merged when saving changes
from a
DataSet temp-table buffer to the associated data source using the
SAVE-ROW-CHANGES() method. |
void |
setMergeByField(logical merge)
Configures whether the changes on a field-by-field basis will be merged when saving changes
from a
DataSet temp-table buffer to the associated data source using the
SAVE-ROW-CHANGES() method. |
void |
setNextRowid(character buffName,
rowid row)
Sets the
ROWID of the data source row at which the next FILL operation
should start. |
void |
setNextRowid(long buffNo,
rowid row)
Sets the
ROWID of the data source row at which the next FILL operation
should start. |
void |
setNextRowid(NumberType buffNo,
rowid row)
Sets the
ROWID of the data source row at which the next FILL operation
should start. |
void |
setNextRowid(rowid row)
Sets the
ROWID of the data source row at which the next FILL operation
should start. |
void |
setNextRowid(java.lang.String buffName,
rowid row)
Sets the
ROWID of the data source row at which the next FILL operation
should start. |
void |
setPreferDataset(boolean pref)
Configures whether the modifications to the data currently in the data source are ignored
when saving changes from a
DataSet temp-table buffer to the associated data source
using the SAVE-ROW-CHANGES() method. |
void |
setPreferDataset(logical pref)
Configures whether the modifications to the data currently in the data source are ignored
when saving changes from a
DataSet temp-table buffer to the associated data source
using the SAVE-ROW-CHANGES() method. |
void |
setQueryAsHandle(handle qry)
Set the query associated with the given resource.
|
void |
setQueryAsHandle(QueryWrapper qry)
Set the query associated with the given resource.
|
private void |
setQueryImpl(handle hQry)
The implementation of assignation of QUERY attribute.
|
void |
setRestartRow(long newRow)
Reposition the
FILL query to an absolute row number. |
void |
setRestartRow(NumberType newRow)
Reposition the
FILL query to an absolute row number. |
void |
setRestartRowid(long buffNum,
rowid row)
Configures the
ROWID of the data source row at which a FILL operation will
start. |
void |
setRestartRowid(NumberType buffNum,
rowid row)
Configures the
ROWID of the data source row at which a FILL operation will
start. |
void |
setRestartRowid(rowid row)
Configures the
ROWID of the data source row at which a FILL operation will
start. |
void |
setRestartRowid(java.lang.String buffName,
rowid row)
Configures the
ROWID of the data source row at which a FILL operation will
start. |
void |
setRestartRowid(Text buffName,
rowid row)
Configures the
ROWID of the data source row at which a FILL operation will
start. |
void |
setSaveWhereString(long buffNum,
java.lang.String val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(long buffNum,
Text val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(NumberType buffNum,
java.lang.String val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(NumberType buffNum,
Text val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(java.lang.String val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(java.lang.String buffName,
java.lang.String val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(java.lang.String buffName,
Text val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(Text val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(Text buffName,
java.lang.String val)
Configures the
SAVE-WHERE-STRING attribute. |
void |
setSaveWhereString(Text buffName,
Text val)
Configures the
SAVE-WHERE-STRING attribute. |
java.lang.String |
toString()
Gets a string representation of the
DataSource object which contains the name, the buffers list
and some details on the active queries, inlcluding their FILL-WHERE-STRING and
PREPARE-STRING. |
(package private) void |
updateFillRowidInfo(boolean success)
Updates the FILL internal data, preparing it for the next batch, if any.
|
boolean |
valid()
Reports if this object is valid for use.
|
_name, delete, firstResource, firstResource, getHead, getNextSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNextSibling, hasParent, hasPrevSibling, hasPrivateData, interlink, isChained, lastResource, lastResource, moveInChain, name, name, name, readOnlyError, readOnlyError, resolveChainType, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData, validateName_instantiatingProcedure, addToPool, doDelete, equals, hashCode, id, id, implicitDeletion, incrementTrigger, instantiatingProcedure, invalidAttribute, processResource, registerResource, resourceType, setInstantiatingProcedure, type, unableToAssignUnknown, unknownclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetPrivateData, setPrivateData, setPrivateDatadynamicresourceTypeid, id, unknownallowDeletepublic static final java.lang.String ROWID_KEY
private final boolean dynamic
CREATE as opposed to statically
defined objects, with DEFINE).private boolean deleted
private DataSource.Builder builder
DataSource using a chaining
set of methods that ends with the registration of the (new) DataSource.private java.lang.String admData
ADM-DATA ABL attribute.private final java.util.List<BufferImpl> buffers
DataSource.private final java.util.Map<BufferImpl,java.lang.Long> nextRowids
private final java.util.Map<BufferImpl,java.lang.Long> restartRowids
private long restartRow
private BufferImpl datasetBuffer
Buffer attached to this DataSource. It must be a DataSet buffer.private handle hImplicitQuery
private handle hExplicitQuery
null and valid, it will take precedence before hImplicitQuery.private boolean preferDataset
PREFER-DATASET attribute. Default value is false.private boolean mergeByField
MERGE-BY-FIELD attribute. Default value is true.private java.lang.String _fillWhereString
FILL-WHERE-STRING attribute, if set programmatically. The default value
is null / unknown, but this value cannot be set programmatically, at runtime.private java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,DataSource.FieldReference>> buf2dsrc
datasetBuffer and fields from this object.private java.util.Map<java.lang.String,java.lang.String> revBuf2src
buf2dsrc map.private final java.util.Map<Buffer,java.lang.String[]> saveWhereStrings
SAVE-WHERE-STRING attribute, mapped by their buffers.private DataSource(boolean staticDef)
staticDef - true when constructor is called form a static DEFINE DATA-SET
statement and false when called from a CREATE DATA-SET statement.public static void create(handle dsHandle)
CREATE DATASOURCE statement. Creates a new
DataSource and stores the object in the supplied handle.dsHandle - The destination handle.public static void create(handle dsHandle, java.lang.String widgetPool)
CREATE DATASOURCE statement. Creates a new
DataSource and stores the object in the supplied handle.dsHandle - The destination handle.widgetPool - The widget pool to created the new DataSource into.public static void create(handle dsHandle, character widgetPool)
CREATE DATASOURCE statement. Creates a new
DataSource and stores the object in the supplied handle.dsHandle - The destination handle.widgetPool - The widget pool to created the new DataSource into.@Deprecated public static DataSource.Builder define()
DataSource. This corresponds to the static
DEFINE DATA-SOURCE statement.Builder object used to chain the options of the statement.public static DataSource.Builder define(java.lang.String legacyName)
DataSource. This corresponds to the static
DEFINE DATA-SOURCE statement.legacyName - The legacy name of the DATA-SOURCE.Builder object used to chain the options of the statement.protected boolean hasNameReadOnly()
hasNameReadOnly in class HandleChainfalse, allowing the name to be altered.protected boolean hasNameConstraints()
hasNameConstraints in class HandleChainfalse, requiring that its name should be
validated before assignment.HandleChain.validateName(java.lang.String)public boolean _dynamic()
true if the buffer is dynamic.
This is not emitted by conversion, is used internally by FWD.
_dynamic in interface DynamicResourcetrue if the resource is dynamic, false otherwise.public boolean valid()
valid in interface WrappedResourcetrue if we are valid (can be used).public handle getPrevSibling()
PREV-SIBLING attribute of this DataSource. Actually always returns null because
this attribute is not supported by DataSources. Only NEXT-SIBLING is supported.getPrevSibling in interface CommonHandleChaingetPrevSibling in class HandleChainnull.public handle getNextSibling()
NEXT-SIBLING attribute of this DataSource. Actually always returns the super's
getPrevSibling() because DataSets are queued in reverse order(!).
TODO: investigate other handle resource that manifest the same from the point of NEXT/PREV-SIBLING.
getNextSibling in interface CommonHandleChaingetNextSibling in class HandleChainnull.public character getADMData()
getADMData in interface ADMDatapublic void setADMData(java.lang.String value)
setADMData in interface ADMDatavalue - The new value.public void setADMData(character value)
setADMData in interface ADMDatavalue - The new value.public handle getQueryAsHandle()
getQueryAsHandle in interface QueryAssociableunknown if none exists.public void setQueryAsHandle(handle qry)
setQueryAsHandle in interface QueryAssociableqry - The query to associate.public void setQueryAsHandle(QueryWrapper qry)
setQueryAsHandle in interface QueryAssociableqry - The query to associate.public logical getPreferDataset()
DataSet temp-table buffer to the associated data source using
the SAVE-ROW-CHANGES() method. The default value is FALSE.getPreferDataset in interface DataSourceInterfacePREFER-DATASET attribute, as described above.public void setPreferDataset(logical pref)
DataSet temp-table buffer to the associated data source
using the SAVE-ROW-CHANGES() method.
This attribute is synonym to IGNORE-CURRENT-MODIFIED. The latter one is deprecated,
but its name is reported in exception message.
setPreferDataset in interface DataSourceInterfacepref - the new value of PREFER-DATASET attribute, as described above.public void setPreferDataset(boolean pref)
DataSet temp-table buffer to the associated data source
using the SAVE-ROW-CHANGES() method.setPreferDataset in interface DataSourceInterfacepref - the new value of PREFER-DATASET attribute, as described above.public character getFillWhereString()
WHERE expression for a data-source query, beginning with the
keyword WHERE, and not including the prior FOR EACH phrase of an
OPEN QUERY statement.getFillWhereString in interface DataSourceInterfaceFILL-WHERE-STRING attribute, as described above.public void setFillWhereString(java.lang.String pref)
WHERE expression for a data-source query, beginning with the
keyword WHERE, and not including the prior FOR EACH phrase of an
OPEN QUERY statement.setFillWhereString in interface DataSourceInterfacepref - The new value of the FILL-WHERE-STRING attribute, as described above.public void setFillWhereString(Text pref)
WHERE expression for a data-source query, beginning with the
keyword WHERE, and not including the prior FOR EACH phrase of an
OPEN QUERY statement.setFillWhereString in interface DataSourceInterfacepref - The new value of the FILL-WHERE-STRING attribute, as described above.public character keys()
public character keys(long seqNum)
public character keys(NumberType seqNum)
public logical getMergeByField()
DataSet temp-table buffer to the associated data source using the
SAVE-ROW-CHANGES() method. The default value is TRUE.getMergeByField in interface DataSourceInterfacetrue if the changes are merged on save on a field-by-field basis.public void setMergeByField(boolean merge)
DataSet temp-table buffer to the associated data source using the
SAVE-ROW-CHANGES() method.setMergeByField in interface DataSourceInterfacemerge - The new value for the MERGE-BY-FIELD attribute.public void setMergeByField(logical merge)
DataSet temp-table buffer to the associated data source using the
SAVE-ROW-CHANGES() method.setMergeByField in interface DataSourceInterfacemerge - The new value for the MERGE-BY-FIELD attribute.public rowid getNextRowid()
ROWID of the data source row at which the next FILL operation
should start. The attribute is set after each FILL operation in a series of
FILL operations to retrieve data source rows in batches.getNextRowid in interface DataSourceInterfaceNEXT-ROWID as described above.public rowid getNextRowid(NumberType buffNo)
ROWID of the data source row at which the next FILL operation
should start. The attribute is set after each FILL operation in a series of
FILL operations to retrieve data source rows in batches.getNextRowid in interface DataSourceInterfacebuffNo - the sequence number of a buffer in the list of buffers for the data-source object.NEXT-ROWID as described above.public rowid getNextRowid(long buffNo)
ROWID of the data source row at which the next FILL operation
should start. The attribute is set after each FILL operation in a series of
FILL operations to retrieve data source rows in batches.getNextRowid in interface DataSourceInterfacebuffNo - the sequence number of a buffer in the list of buffers for the data-source object.NEXT-ROWID as described above.public rowid getNextRowid(java.lang.String buffName)
ROWID of the data source row at which the next FILL operation
should start. The attribute is set after each FILL operation in a series of
FILL operations to retrieve data source rows in batches.getNextRowid in interface DataSourceInterfacebuffName - The name of a buffer in the list of buffers for the data-source object.NEXT-ROWID as described above.public rowid getNextRowid(character buffName)
ROWID of the data source row at which the next FILL operation
should start. The attribute is set after each FILL operation in a series of
FILL operations to retrieve data source rows in batches.getNextRowid in interface DataSourceInterfacebuffName - The name of a buffer in the list of buffers for the data-source object.NEXT-ROWID as described above.public void setNextRowid(rowid row)
ROWID of the data source row at which the next FILL operation
should start. Typically, the value of this attribute is assigned to the
RESTART-ROWID attribute before each FILL operation.setNextRowid in interface DataSourceInterfacerow - The new value of code NEXT-ROWID as described above.public void setNextRowid(NumberType buffNo, rowid row)
ROWID of the data source row at which the next FILL operation
should start. Typically, the value of this attribute is assigned to the
RESTART-ROWID attribute before each FILL operation.setNextRowid in interface DataSourceInterfacebuffNo - the sequence number of a buffer in the list of buffers for the data-source object.row - The new value of code NEXT-ROWID as described above.public void setNextRowid(long buffNo,
rowid row)
ROWID of the data source row at which the next FILL operation
should start. Typically, the value of this attribute is assigned to the
RESTART-ROWID attribute before each FILL operation.setNextRowid in interface DataSourceInterfacebuffNo - the sequence number of a buffer in the list of buffers for the data-source object.row - The new value of code NEXT-ROWID as described above.public void setNextRowid(java.lang.String buffName,
rowid row)
ROWID of the data source row at which the next FILL operation
should start. Typically, the value of this attribute is assigned to the
RESTART-ROWID attribute before each FILL operation.setNextRowid in interface DataSourceInterfacebuffName - The name of a buffer in the list of buffers for the data-source object.row - The new value of code NEXT-ROWID as described above.public void setNextRowid(character buffName, rowid row)
ROWID of the data source row at which the next FILL operation
should start. Typically, the value of this attribute is assigned to the
RESTART-ROWID attribute before each FILL operation.setNextRowid in interface DataSourceInterfacebuffName - The name of a buffer in the list of buffers for the data-source object.row - The new value of code NEXT-ROWID as described above.public integer getNumSourceBuffers()
getNumSourceBuffers in interface DataSourceInterfacepublic integer getRestartRow()
FILL query.getRestartRow in interface DataSourceInterfaceRESTART-ROW attribute.public void setRestartRow(long newRow)
FILL query to an absolute row number.setRestartRow in interface DataSourceInterfacenewRow - The new row number to reposition the query.public void setRestartRow(NumberType newRow)
FILL query to an absolute row number.setRestartRow in interface DataSourceInterfacenewRow - The new row number to reposition the query.public rowid getRestartRowid()
ROWID of the data source row at which a FILL operation will
start.getRestartRowid in interface DataSourceInterfaceRESTART-ROWID attribute.public rowid getRestartRowid(NumberType buffNum)
ROWID of the data source row at which a FILL operation will
start.getRestartRowid in interface DataSourceInterfacebuffNum - The index of the buffer.RESTART-ROWID attribute.public rowid getRestartRowid(long buffNum)
ROWID of the data source row at which a FILL operation will
start.getRestartRowid in interface DataSourceInterfacebuffNum - The index of the buffer.RESTART-ROWID attribute.public rowid getRestartRowid(Text buffName)
ROWID of the data source row at which a FILL operation will
start.getRestartRowid in interface DataSourceInterfacebuffName - The name of the buffer.RESTART-ROWID attribute.public rowid getRestartRowid(java.lang.String buffName)
ROWID of the data source row at which a FILL operation will
start.getRestartRowid in interface DataSourceInterfacebuffName - The name of the buffer.RESTART-ROWID attribute.public void setRestartRowid(rowid row)
ROWID of the data source row at which a FILL operation will
start. Set this attribute before each FILL operation in a series of FILL
operations to retrieve data source rows in batches. Typically, this attribute is set by
assigning the value of the NEXT-ROWID attribute, after each FILL operation.setRestartRowid in interface DataSourceInterfacerow - The new value for RESTART-ROWID attribute as described above.public void setRestartRowid(NumberType buffNum, rowid row)
ROWID of the data source row at which a FILL operation will
start. Set this attribute before each FILL operation in a series of FILL
operations to retrieve data source rows in batches. Typically, this attribute is set by
assigning the value of the NEXT-ROWID attribute, after each FILL operation.setRestartRowid in interface DataSourceInterfacebuffNum - The index of the buffer.row - The new value for RESTART-ROWID attribute as described above.public void setRestartRowid(long buffNum,
rowid row)
ROWID of the data source row at which a FILL operation will
start. Set this attribute before each FILL operation in a series of FILL
operations to retrieve data source rows in batches. Typically, this attribute is set by
assigning the value of the NEXT-ROWID attribute, after each FILL operation.setRestartRowid in interface DataSourceInterfacebuffNum - The index of the buffer.row - The new value for RESTART-ROWID attribute as described above.public void setRestartRowid(Text buffName, rowid row)
ROWID of the data source row at which a FILL operation will
start. Set this attribute before each FILL operation in a series of FILL
operations to retrieve data source rows in batches. Typically, this attribute is set by
assigning the value of the NEXT-ROWID attribute, after each FILL operation.setRestartRowid in interface DataSourceInterfacebuffName - The name of the buffer.row - The new value for RESTART-ROWID attribute as described above.public void setRestartRowid(java.lang.String buffName,
rowid row)
ROWID of the data source row at which a FILL operation will
start. Set this attribute before each FILL operation in a series of FILL
operations to retrieve data source rows in batches. Typically, this attribute is set by
assigning the value of the NEXT-ROWID attribute, after each FILL operation.setRestartRowid in interface DataSourceInterfacebuffName - The name of the buffer.row - The new value for RESTART-ROWID attribute as described above.public character getSaveWhereString()
WHERE clause used to find the database buffer identified by the
buffName in a data-source object.getSaveWhereString in interface DataSourceInterfaceWHERE clause used to find the specified buffer.public character getSaveWhereString(NumberType buffNum)
WHERE clause used to find the database buffer identified by the
buffName in a data-source object.getSaveWhereString in interface DataSourceInterfacebuffNum - The buffer index.WHERE clause used to find the specified buffer.public character getSaveWhereString(long buffNum)
WHERE clause used to find the database buffer identified by the
buffName in a data-source object.getSaveWhereString in interface DataSourceInterfacebuffNum - The buffer index.WHERE clause used to find the specified buffer.public character getSaveWhereString(Text buffName)
WHERE clause used to find the database buffer identified by the
buffName in a data-source object.getSaveWhereString in interface DataSourceInterfacebuffName - The buffer name.WHERE clause used to find the specified buffer.public character getSaveWhereString(java.lang.String buffName)
WHERE clause used to find the database buffer identified by the
buffName in a data-source object.getSaveWhereString in interface DataSourceInterfacebuffName - The buffer name.WHERE clause used to find the specified buffer.public void setSaveWhereString(Text val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfaceval - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(NumberType buffNum, Text val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfacebuffNum - The buffer index.val - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(long buffNum,
Text val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfacebuffNum - The buffer index.val - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(Text buffName, Text val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfacebuffName - The buffer name.val - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(java.lang.String buffName,
Text val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfacebuffName - The buffer name.val - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(java.lang.String val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfaceval - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(NumberType buffNum, java.lang.String val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfacebuffNum - The buffer index.val - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(long buffNum,
java.lang.String val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfacebuffNum - The buffer index.val - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(Text buffName, java.lang.String val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfacebuffName - The buffer name.val - The new value for SAVE-WHERE-STRING attribute.public void setSaveWhereString(java.lang.String buffName,
java.lang.String val)
SAVE-WHERE-STRING attribute.setSaveWhereString in interface DataSourceInterfacebuffName - The buffer name.val - The new value for SAVE-WHERE-STRING attribute.public logical isIgnoreCurrentModified()
DataSet temp-table buffer to the associated data source using
the Buffer.saveRowChanges() method.
This attribute is supported only for backward compatibility. Use the
getPreferDataset() method instead.
isIgnoreCurrentModified in interface DataSourceInterfaceIGNORE-CURRENT-MODIFIED attribute.public void setIgnoreCurrentModified(boolean on)
DataSet temp-table buffer to the associated data source using
the Buffer.saveRowChanges() method.
This attribute is supported only for backward compatibility. Use the
setPreferDataset(com.goldencode.p2j.util.logical) method instead.
setIgnoreCurrentModified in interface DataSourceInterfaceon - The new value of IGNORE-CURRENT-MODIFIED attribute.public void setIgnoreCurrentModified(logical on)
DataSet temp-table buffer to the associated data source using
the Buffer.saveRowChanges() method.
This attribute is supported only for backward compatibility. Use the
setPreferDataset(com.goldencode.p2j.util.logical) method instead.
setIgnoreCurrentModified in interface DataSourceInterfaceon - The new value of IGNORE-CURRENT-MODIFIED attribute.public logical addSourceBuffer(Buffer buf)
buf - The buffer to be added.true on success.public logical addSourceBuffer(handle hBuf, Text keyFields)
addSourceBuffer in interface DataSourceInterfacehBuf - The buffer handle to be added.keyFields - A list of one or more comma-separated database table fields that constitute a
unique keytrue on success.public logical addSourceBuffer(handle hBuf, java.lang.String keyFields)
addSourceBuffer in interface DataSourceInterfacehBuf - The buffer handle to be added.keyFields - A list of one or more comma-separated database table fields that constitute a
unique keytrue on success.public handle getSourceBuffer()
getSourceBuffer in interface DataSourceInterfacepublic BufferImpl getSourceBufferNative()
public handle getSourceBuffer(long bufIndex)
getSourceBuffer in interface DataSourceInterfacebufIndex - The index of the requested buffer.public BufferImpl getSourceBufferNative(long bufIndex)
bufIndex - The index of the requested buffer.public handle getSourceBuffer(NumberType bufIndex)
getSourceBuffer in interface DataSourceInterfacebufIndex - The index of the requested buffer.public handle getDatasetBuffer()
DataSource.getDatasetBuffer in interface DataSourceInterfaceprotected boolean resourceDelete()
resourceDelete in class HandleResourcetrue if the resource was deleted.int getSourceBufferIndex(java.lang.String bufName)
null is returned.bufName - The name of the desired source buffer.int _getNumSourceBuffers()
void attach(BufferImpl buffer, java.util.List<org.apache.commons.lang3.tuple.Pair<java.lang.String,DataSource.FieldReference>> buf2dsrc)
buffer - The buffer to be attached. If null is passed, the currently attached buffer
is detached.buf2dsrc - The mapping between the dataset buffer and the fields of this object (these may
come from different tables).java.lang.Long[] getRestartRowids()
RESTART-ROWID-s for this DataSource. The order is important,
it is the order in which the buffers were added at first.RESTART-ROWID.void updateFillRowidInfo(boolean success)
RESTART-ROWID. All values will become unknown.NEXT-ROWID values with the rowids currently selected
in buffers. They were not processed yet so they are the 'NEXT' rows.FILL operation failed, the NEXT-ROWID will be also set to unknown.success - true if the fill ended with success.private java.lang.String computeFillWhereString()
FILL-WHERE-STRING attribute at this moment. Depending on the active
relations from the dataset, this value may change.FILL-WHERE-STRING attribute.private void setQueryImpl(handle hQry)
hQry - The handle to the new query to be assigned.private logical addSourceBufferImpl(BufferImpl buffer, java.lang.String[] keyFields)
ADD-SOURCE-BUFFER method. The addSourceBuffer(com.goldencode.p2j.persist.Buffer)
method will call this method after preliminary validating the parameters.buffer - The buffer to add.keyFields - The fields set that for a unique index.true on success.private boolean isAlterable()
DataSource s are not alterable, but they can 'altered' by their
Builder while the object is being constructed.true if new buffers or relations can be added.java.lang.String getSaveWhereStringImpl(Buffer buf, boolean useBefore)
SAVE-WHERE-STRING for a specified Buffer. If this
is the first time the attribute is accessed, its value is (lazily) computed.buf - A buffer to obtain its save where string.useBefore - Use the before-table name to construct the returned SAVE-WHERE-STRING (used for SAVE
operation), as opposed to the after-table name (used for DATA-SOURCE-ROWID attribute).SAVE-WHERE-STRING for buf.boolean hasExplicitQuery()
true if a custom query was set for this data-source.private boolean createImplicitQuery()
true if a new query was created and prepared.public java.lang.String toString()
DataSource object which contains the name, the buffers list
and some details on the active queries, inlcluding their FILL-WHERE-STRING and
PREPARE-STRING. This method is a usual debug tool.toString in class HandleResourceDataSource object.