|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.query.up.Updates
public final class Updates
Implementation of the W3C XQUERY UPDATE FACILITY 1.0.
Holds all update operations and primitives a snapshot contains, checks constraints and finally executes the updates.
Fragment updates are treated like database updates. An artificial data instance is created for each fragment. Ultimately the updating process for a fragment is the same as for a database node.
The complete updating process is custom-tailored to the sequential table encoding of BaseX. As a general rule, all updates are collected and applied for each database from bottom to top, regarding the PRE values of the corresponding target nodes. Updates on the highest PRE values are applied first.
Updates work like the following:
UpdatePrimitive
.DatabaseUpdates
NodeUpdates
TransformModifier
. All the other updates are executed by
a DatabaseModifier
.UpdatePrimitiveComparator
helps to order
UpdatePrimitive
for execution. Each primitive then creates a sequence of
BasicUpdate
which are passed to the Data
layer via an
AtomicUpdateList
. This list takes care of optimization and also text node
merging.
Field Summary | |
---|---|
ContextModifier |
mod
Current context modifier. |
TokenSet |
putPaths
All file paths that are targeted during a snapshot by an fn:put expression. |
Constructor Summary | |
---|---|
Updates()
|
Method Summary | |
---|---|
void |
add(Operation up,
QueryContext ctx)
Adds an update primitive to the current context modifier. |
void |
apply()
Executes all updates. |
StringList |
databases()
Adds all databases to be updated to the specified list. |
DBNode |
determineDataRef(ANode target,
QueryContext ctx)
Determines the data reference and pre value for an update primitive which has a fragment as a target node. |
int |
size()
Number of updates on the pending update list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public ContextModifier mod
public final TokenSet putPaths
Constructor Detail |
---|
public Updates()
Method Detail |
---|
public void add(Operation up, QueryContext ctx) throws QueryException
up
- update primitivectx
- query context
QueryException
- query exceptionpublic DBNode determineDataRef(ANode target, QueryContext ctx)
target
- target fragmentctx
- query context
public void apply() throws QueryException
QueryException
- query exceptionpublic StringList databases()
public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |