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.Map<CaseInsensitiveString,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 java.util.Map<Buffer,java.util.List<java.lang.String>> |
keys
The set of keys (components of an unique index) that identifies the records in key -buffer.
|
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 handle |
query
The query that defines the buffers for the data-source object.
|
private java.util.Map<BufferImpl,java.lang.Long> |
restartRowids
The current values of RESTART-ROWID attributes.
|
private java.util.Map<CaseInsensitiveString,java.lang.String> |
revBuf2src
The reversed
buf2dsrc map. |
private 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
instProc
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(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.Map<CaseInsensitiveString,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.
|
static DataSource.Builder |
define()
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. |
private java.lang.String |
getSaveWhereStringImpl(Buffer buf)
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.
|
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. |
private void |
setParentBuffer()
Sets the parent buffer as substitution buffer in the query.
|
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(WrappedResource qry)
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. |
(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.
|
delete, firstResource, firstResource, getHead, getNextSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNextSibling, hasParent, hasPrevSibling, hasPrivateData, interlink, isChained, lastResource, lastResource, moveInChain, name, name, name, readOnlyError, readOnlyError, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData, validateName
doDelete, getResourceType, id, id, implicitDeletion, incrementTrigger, instantiatingProcedure, invalidAttribute, processResource, registerResource, setInstantiatingProcedure, toString, type, unableToAssignUnknown, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPrivateData, setPrivateData, setPrivateData
dynamic
getResourceType
id, id, unknown
private 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 BufferImpl datasetBuffer
Buffer
attached to this DataSource
. It must be a DataSet
buffer.private final java.util.Map<Buffer,java.util.List<java.lang.String>> keys
private final handle query
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.Map<CaseInsensitiveString,DataSource.FieldReference> buf2dsrc
datasetBuffer
and fields from this object.private java.util.Map<CaseInsensitiveString,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.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.protected boolean hasNameReadOnly()
hasNameReadOnly
in class HandleChain
false
, allowing the name to be altered.protected boolean hasNameConstraints()
hasNameConstraints
in class HandleChain
false
, 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 DynamicResource
true
if the resource is dynamic, false
otherwise.public boolean valid()
valid
in interface WrappedResource
true
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 CommonHandleChain
getPrevSibling
in class HandleChain
null
.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 CommonHandleChain
getNextSibling
in class HandleChain
null
.public character getADMData()
getADMData
in interface ADMData
public void setADMData(java.lang.String value)
setADMData
in interface ADMData
value
- The new value.public void setADMData(character value)
setADMData
in interface ADMData
value
- The new value.public handle getQueryAsHandle()
getQueryAsHandle
in interface QueryAssociable
unknown
if none exists.public void setQueryAsHandle(handle qry)
setQueryAsHandle
in interface QueryAssociable
qry
- The query to associate.public void setQueryAsHandle(QueryWrapper qry)
setQueryAsHandle
in interface QueryAssociable
qry
- 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 DataSourceInterface
PREFER-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 DataSourceInterface
pref
- 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 DataSourceInterface
pref
- 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 DataSourceInterface
FILL-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 DataSourceInterface
pref
- 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 DataSourceInterface
pref
- 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 DataSourceInterface
true
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 DataSourceInterface
merge
- 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 DataSourceInterface
merge
- 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 DataSourceInterface
NEXT-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 DataSourceInterface
buffNo
- 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 DataSourceInterface
buffNo
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
row
- 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 DataSourceInterface
buffNo
- 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 DataSourceInterface
buffNo
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
public integer getRestartRow()
FILL
query.getRestartRow
in interface DataSourceInterface
RESTART-ROW
attribute.public void setRestartRow(long newRow)
FILL
query to an absolute row number.setRestartRow
in interface DataSourceInterface
newRow
- The new row number to reposition the query.public void setRestartRow(NumberType newRow)
FILL
query to an absolute row number.setRestartRow
in interface DataSourceInterface
newRow
- 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 DataSourceInterface
RESTART-ROWID
attribute.public rowid getRestartRowid(NumberType buffNum)
ROWID
of the data source row at which a FILL
operation will
start.getRestartRowid
in interface DataSourceInterface
buffNum
- 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 DataSourceInterface
buffNum
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
row
- 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 DataSourceInterface
buffNum
- 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 DataSourceInterface
buffNum
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
WHERE
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 DataSourceInterface
buffNum
- 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 DataSourceInterface
buffNum
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
buffName
- The buffer name.WHERE
clause used to find the specified buffer.public void setSaveWhereString(Text val)
SAVE-WHERE-STRING
attribute.setSaveWhereString
in interface DataSourceInterface
val
- The new value for SAVE-WHERE-STRING
attribute.public void setSaveWhereString(NumberType buffNum, Text val)
SAVE-WHERE-STRING
attribute.setSaveWhereString
in interface DataSourceInterface
buffNum
- 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 DataSourceInterface
buffNum
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
val
- The new value for SAVE-WHERE-STRING
attribute.public void setSaveWhereString(NumberType buffNum, java.lang.String val)
SAVE-WHERE-STRING
attribute.setSaveWhereString
in interface DataSourceInterface
buffNum
- 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 DataSourceInterface
buffNum
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
buffName
- 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 DataSourceInterface
IGNORE-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 DataSourceInterface
on
- 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 DataSourceInterface
on
- The new value of IGNORE-CURRENT-MODIFIED
attribute.public logical addSourceBuffer(handle hBuf, Text keyFields)
addSourceBuffer
in interface DataSourceInterface
hBuf
- 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 DataSourceInterface
hBuf
- 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 DataSourceInterface
public handle getSourceBuffer(long bufIndex)
getSourceBuffer
in interface DataSourceInterface
bufIndex
- The index of the requested buffer.public handle getSourceBuffer(NumberType bufIndex)
getSourceBuffer
in interface DataSourceInterface
bufIndex
- The index of the requested buffer.public handle getDatasetBuffer()
DataSource
.getDatasetBuffer
in interface DataSourceInterface
protected boolean resourceDelete()
resourceDelete
in class HandleResource
true
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.Map<CaseInsensitiveString,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(WrappedResource qry)
qry
- The new query to be assigned.private logical addSourceBufferImpl(BufferImpl buffer, java.lang.String[] keyFields)
ADD-SOURCE-BUFFER
method. The addSourceBuffer(com.goldencode.p2j.util.handle, com.goldencode.p2j.util.Text)
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.private java.lang.String getSaveWhereStringImpl(Buffer buf)
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.SAVE-WHERE-STRING
for buf
.private void setParentBuffer()