public interface RowManager
Modifier and Type | Interface and Description |
---|---|
static class |
RowManager.RowSetPart
Distinguishes between the header and rows that
constitute a row set.
|
static class |
RowManager.RowStructure
Distinguishes between rows in an object
structure or array structure.
|
Modifier and Type | Method and Description |
---|---|
<T extends JSONReadHandle> |
columnInfo(PlanBuilder.Plan plan,
T handle)
This function can be used to inspect the state
of a plan before execution.
|
<T> T |
columnInfoAs(PlanBuilder.Plan plan,
java.lang.Class<T> as)
This function can be used to inspect the state
of a plan before execution.
|
void |
execute(PlanBuilder.Plan plan)
Execute the given plan without returning any
result.
|
void |
execute(PlanBuilder.Plan plan,
Transaction transaction)
Execute the given plan without returning any
result.
|
<T extends StructureReadHandle> |
explain(PlanBuilder.Plan plan,
T handle)
Constructs a plan for retrieving a set of
database rows and returns a handle for the explanation of the plan
as a JSON or XML structure.
|
<T> T |
explainAs(PlanBuilder.Plan plan,
java.lang.Class<T> as)
Constructs a plan for retrieving a set of
database rows and returns an explanation of the plan in the
representation specified by the IO class.
|
<T extends XMLReadHandle> |
generateView(PlanBuilder.PreparePlan plan,
java.lang.String schema, java.lang.String view,
T handle)
Generates generates a view that encapsulates a
plan.
|
<T> T |
generateViewAs(PlanBuilder.PreparePlan plan,
java.lang.String schema, java.lang.String view,
java.lang.Class<T> as)
Generates generates a view that encapsulates a
plan.
|
RowManager.RowSetPart |
getDatatypeStyle()
Returns whether data types should be emitted in
each row (the default) or in the header in the response for
requests made with the row manager.
|
java.lang.Integer |
getOptimize() |
RowManager.RowStructure |
getRowStructureStyle()
Returns whether each row should have an array or
object structure in the response for requests made with the row
manager.
|
java.lang.String |
getTraceLabel() |
<T extends JSONReadHandle> |
graphql(JSONWriteHandle query,
T resultsHandle)
Executes a GraphQL query against the database
and returns the results as a JSON object.
|
<T> T |
graphqlAs(JSONWriteHandle query,
java.lang.Class<T> as)
Executes a GraphQL query against the database
and returns the results as a JSON object.
|
PlanBuilder |
newPlanBuilder()
Creates a builder to define a plan for
constructing and retrieving database rows.
|
RawPlanDefinition |
newRawPlanDefinition(JSONWriteHandle handle)
Defines a plan from a JSON serialization of the
plan AST (Abstract Syntax Tree).
|
RawQueryDSLPlan |
newRawQueryDSLPlan(TextWriteHandle handle)
Defines a plan from a Query DSL in a JavaScript
serialization.
|
RawSPARQLSelectPlan |
newRawSPARQLSelectPlan(TextWriteHandle handle)
Defines a plan from a SPARQL SELECT query.
|
RawSQLPlan |
newRawSQLPlan(TextWriteHandle handle)
Defines a plan from an SQL query.
|
<T extends StructureReadHandle> |
resultDoc(PlanBuilder.Plan plan,
T handle)
Constructs and retrieves a set of database rows
based on a plan using a handle to get the set of rows as a single
JSON or XML structure.
|
<T extends StructureReadHandle> |
resultDoc(PlanBuilder.Plan plan,
T handle, Transaction transaction)
Constructs and retrieves a set of database rows
based on a plan using a handle to get the set of rows as a single
JSON or XML structure and reflecting documents written or deleted
by an uncommitted transaction.
|
<T> T |
resultDocAs(PlanBuilder.Plan plan,
java.lang.Class<T> as)
Constructs and retrieves a set of database rows
based on a plan in the representation specified by the IO
class.
|
<T> T |
resultDocAs(PlanBuilder.Plan plan,
java.lang.Class<T> as, Transaction transaction)
Constructs and retrieves a set of database rows
based on a plan in the representation specified by the IO class and
reflecting documents written or deleted by an uncommitted
transaction.
|
RowSet<RowRecord> |
resultRows(PlanBuilder.Plan plan)
Constructs and retrieves a set of database rows
based on a plan using a map interface for the column values in each
row.
|
<T extends StructureReadHandle> |
resultRows(PlanBuilder.Plan plan,
T rowHandle)
Constructs and retrieves a set of database rows
based on a plan using a JSON or XML handle for each row.
|
RowSet<RowRecord> |
resultRows(PlanBuilder.Plan plan,
Transaction transaction)
Constructs and retrieves a set of database rows
based on a plan using a map interface and reflecting documents
written or deleted by an uncommitted transaction.
|
<T extends StructureReadHandle> |
resultRows(PlanBuilder.Plan plan,
T rowHandle, Transaction transaction)
Constructs and retrieves a set of database rows
based on a plan using a JSON or XML handle for each row and
reflecting documents written or deleted by an uncommitted
transaction.
|
<T> RowSet<T> |
resultRowsAs(PlanBuilder.Plan plan,
java.lang.Class<T> as)
Constructs and retrieves a set of database rows
based on a plan using a JSON or XML handle for each row and
reflecting documents written or deleted by an uncommitted
transaction.
|
<T> RowSet<T> |
resultRowsAs(PlanBuilder.Plan plan,
java.lang.Class<T> as, Transaction transaction)
Constructs and retrieves a set of database rows
based on a plan using a JSON or XML handle for each row and
reflecting documents written or deleted by an uncommitted
transaction.
|
void |
setDatatypeStyle(RowManager.RowSetPart style)
Specifies whether to emit the data type of each
column in each row or only in the header in the response for
requests made with the row manager.
|
void |
setOptimize(java.lang.Integer value)
Set an optional optimization level.
|
void |
setRowStructureStyle(RowManager.RowStructure style)
Specifies whether to get each row as an object
(the default) or as an array in the response for requests made with
the row manager.
|
void |
setTraceLabel(java.lang.String label)
Set an optional label and enable the "optic"
trace event for the duration of each plan execution
|
RowManager |
withUpdate(boolean update)
As of MarkLogic 11.2, the "v1/rows/update"
endpoint must be used in order to submit an Optic plan that
performs an update.
|
PlanBuilder newPlanBuilder()
RowManager.RowSetPart getDatatypeStyle()
void setDatatypeStyle(RowManager.RowSetPart style)
style
- the part of the rowset that should contain
data typesRowManager.RowStructure getRowStructureStyle()
void setRowStructureStyle(RowManager.RowStructure style)
style
- the structure of rows in the responsevoid setTraceLabel(java.lang.String label)
label
-RowManager withUpdate(boolean update)
true
in order for that endpoint to be used instead of
"v1/rows". You may later call this method with a value of
false
in order to submit a plan that does not perform
an update.update
- set to true
if submitting a
plan that performs an updatejava.lang.String getTraceLabel()
void setOptimize(java.lang.Integer value)
value
-java.lang.Integer getOptimize()
RawPlanDefinition newRawPlanDefinition(JSONWriteHandle handle)
handle
- a handle for a JSON serialization of a
plan ASTRawQueryDSLPlan newRawQueryDSLPlan(TextWriteHandle handle)
handle
- a textual handle for Query DSL in
JavaScript formatRawSQLPlan newRawSQLPlan(TextWriteHandle handle)
handle
- a textual handle for the SQL
serializationRawSPARQLSelectPlan newRawSPARQLSelectPlan(TextWriteHandle handle)
handle
- a textual handle for the SPARQL
serializationvoid execute(PlanBuilder.Plan plan)
plan
- the definition of a planvoid execute(PlanBuilder.Plan plan, Transaction transaction)
plan
- the definition of a plantransaction
- a open transaction for the execute
operation to run withinRowSet<RowRecord> resultRows(PlanBuilder.Plan plan)
plan
- the definition of a plan for the database
rowsRowSet<RowRecord> resultRows(PlanBuilder.Plan plan, Transaction transaction)
plan
- the definition of a plan for the database
rowstransaction
- a open transaction for documents
from which rows have been projected<T extends StructureReadHandle> RowSet<T> resultRows(PlanBuilder.Plan plan, T rowHandle)
T
- the type of the row handleplan
- the definition of a plan for the database
rowsrowHandle
- the JSON or XML handle that provides
each row<T extends StructureReadHandle> RowSet<T> resultRows(PlanBuilder.Plan plan, T rowHandle, Transaction transaction)
T
- the type of the row handleplan
- the definition of a plan for the database
rowsrowHandle
- the JSON or XML handle that provides
each rowtransaction
- a open transaction for documents
from which rows have been projected<T> RowSet<T> resultRowsAs(PlanBuilder.Plan plan, java.lang.Class<T> as)
ContentHandle
are registered. Learn more
about shortcut methodsT
- the type of object that will be returned by
the handle registered for itplan
- the definition of a plan for the database
rowsas
- the IO class for reading each row as JSON or
XML content<T> RowSet<T> resultRowsAs(PlanBuilder.Plan plan, java.lang.Class<T> as, Transaction transaction)
ContentHandle
are registered. Learn more
about shortcut methodsT
- the type of object that will be returned by
the handle registered for itplan
- the definition of a plan for the database
rowsas
- the IO class for reading each row as JSON or
XML contenttransaction
- a open transaction for documents
from which rows have been projected<T extends StructureReadHandle> T resultDoc(PlanBuilder.Plan plan, T handle)
T
- the type of the row handleplan
- the definition of a plan for the database
rowshandle
- the JSON or XML handle for the set of
rows<T extends StructureReadHandle> T resultDoc(PlanBuilder.Plan plan, T handle, Transaction transaction)
T
- the type of the row handleplan
- the definition of a plan for the database
rowshandle
- the JSON or XML handle for the set of
rowstransaction
- a open transaction for documents
from which rows have been projected<T> T resultDocAs(PlanBuilder.Plan plan, java.lang.Class<T> as)
ContentHandle
are registered. Learn more
about shortcut methodsT
- the type of the IO object for reading the set
of rowsplan
- the definition of a plan for the database
rowsas
- the IO class for reading the set of rows<T> T resultDocAs(PlanBuilder.Plan plan, java.lang.Class<T> as, Transaction transaction)
ContentHandle
are registered. Learn more
about shortcut methodsT
- the type of the IO object for reading the set
of rowsplan
- the definition of a plan for the database
rowsas
- the IO class for reading the set of rowstransaction
- a open transaction for documents
from which rows have been projected<T extends StructureReadHandle> T explain(PlanBuilder.Plan plan, T handle)
T
- the type of the explanation handleplan
- the definition of a plan for database
rowshandle
- the JSON or XML handle on the explanation
for the plan<T> T explainAs(PlanBuilder.Plan plan, java.lang.Class<T> as)
ContentHandle
are registered. Learn more
about shortcut methodsT
- the type of the IO object for reading the
explanationplan
- the definition of a plan for database
rowsas
- the IO class for reading the explanation for
the plan<T extends XMLReadHandle> T generateView(PlanBuilder.PreparePlan plan, java.lang.String schema, java.lang.String view, T handle)
PlanBuilder.fromView(String, String)
accessor to
query against the generated view.T
- the type of the handle for the generated
viewplan
- the definition of a plan for database
rowsschema
- the name of the schema for the new view
generated from the planview
- the name of the new view generated from the
planhandle
- the XML handle on the generated view for
the plan<T> T generateViewAs(PlanBuilder.PreparePlan plan, java.lang.String schema, java.lang.String view, java.lang.Class<T> as)
PlanBuilder.fromView(String, String)
accessor to
query against the generated view. The IO class must have been
registered before creating the database client. By default, the
provided handles that implement ContentHandle
are registered. Learn more
about shortcut methodsT
- the type of the IO object for reading the
generated viewplan
- the definition of a plan for database
rowsschema
- the name of the schema for the new view
generated from the planview
- the name of the new view generated from the
planas
- the IO class for reading the generated view
for the plan<T extends JSONReadHandle> T columnInfo(PlanBuilder.Plan plan, T handle)
T
- the type of the handle for the column
informationplan
- the definition of a plan for database
rowshandle
- the Json handle on the column information
for the plan<T> T columnInfoAs(PlanBuilder.Plan plan, java.lang.Class<T> as)
ContentHandle
are registered. Learn more
about shortcut methodsT
- the type of the IO object for reading the
column informationplan
- the definition of a plan for database
rowsas
- the IO class for reading the column
information for the plan<T extends JSONReadHandle> T graphql(JSONWriteHandle query, T resultsHandle)
T
- the type of the IO object for r the
resultsquery
- the GraphQL query to executeresultsHandle
- the IO class for capturing the
results<T> T graphqlAs(JSONWriteHandle query, java.lang.Class<T> as)
T
- the type of the results to returnquery
- the GraphQL query to executeas
- the class type of the results to return;
typically JsonNode or StringCopyright © 2024 MarkLogic Corporation. All Rights Reserved.