public class DataSource.Builder
extends java.lang.Object
DataSource
object statically, that is, using
the DEFINE DataSource
statement. It exposes a set of chaining methods that take each
option parameters and set them into the DataSource
being constructed. The chaining
must finish with generate()
to obtain the final DataSource
object. Before
returning, the generate()
will do the final checks before returning.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
DataSource.Builder |
addBuffer(Buffer buf,
boolean rowid)
Corresponds to
FOR option from DEFINE DATASOURCE statement. |
DataSource.Builder |
addBuffer(Buffer buf,
java.lang.String... fields)
Configures the a buffer for the
DataSource . |
DataSource |
generate()
Finalizes the build of the
DataSource . |
DataSource.Builder |
setQuery(QueryWrapper query)
Sets the query associated with the given resource.
|
public DataSource.Builder addBuffer(Buffer buf, java.lang.String... fields)
DataSource
. Corresponds to FOR
option
from DEFINE DATASOURCE
statement. The syntax allows to specify none or more
fields.buf
- The buffer for the DataSource
to be constructed.fields
- The set of fields (if any) that that form a unique key.public DataSource.Builder addBuffer(Buffer buf, boolean rowid)
FOR
option from DEFINE DATASOURCE
statement. This
particular syntax allows to specify the ROWID as the key for record lookup.buf
- The buffer for the DataSource
to be constructed.rowid
- This boolean will be ignored. It is used only to distinct the overloaded method.public DataSource.Builder setQuery(QueryWrapper query)
query
- The query to associate.public DataSource generate()
DataSource
.DataSource
that have been constructed.