public enum PrimitiveType extends java.lang.Enum<PrimitiveType>
Update primitive type enumeration.
The type order corresponds to the order updates are carried out node-wise. The XQuery Update Facility specification proposes the following order:
Why does it differ from the specification?
We apply the order to each single target node instead of a document (like stated in the specification). The result stays the same.
Put is executed before replace, delete and insert before as the node to be serialized has already been updated and applying replace, delete or insert before would change its pre value or kill its identity.
For all other operations, concerning the order the following rule applies: Updates are applied from bottom to top regarding the data table. This means the update primitive which affects the highest pre value comes first, etc.
'Insert into as last' is carried out after 'insert into' as we have to make sure that location modifiers are correctly applied.
'Replace element content' must be executed after 'insert into as first' to replace nodes inserted by 'insert into as first'.
The following list shows the affected pre value for each primitive type relative to its target node pre value P. An 'S' in the first column means that the corresponding primitive could lead to structural changes of the table -> a shift of pre values.
P: target pre value
S: may lead to structural change
size(), attSize() -> see Data
Primitive Affected Pre
----------------------------------------
S insert after P + size(P)
S insert into P + size(P)
S insert into as last P + size(P)
S insert attribute P + attSize(P)
S insert into as first P + attSize(P)
S replace elm content P + attSize(P) //attributes not affected
S replace value P //inserting empty txt node -> S
rename P
put P
S replace P
S delete P
S insert before P
| Enum Constant and Description |
|---|
DBDELETE
DBDelete.
|
DBOPTIMIZE
DBOptimize.
|
DBRENAME
DBRename.
|
DBSTORE
DBSTORE.
|
DELETENODE
Delete.
|
INSERTAFTER
Insert after.
|
INSERTATTR
Insert attribute.
|
INSERTBEFORE
Insert before.
|
INSERTINTO
Insert into.
|
INSERTINTOFIRST
Insert into as first.
|
INSERTINTOLAST
Insert into as last.
|
PUT
Put.
|
RENAMENODE
Rename.
|
REPLACEELEMCONT
Replace element content.
|
REPLACENODE
Replace node.
|
REPLACEVALUE
Replace value.
|
| Modifier and Type | Method and Description |
|---|---|
static PrimitiveType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static PrimitiveType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PrimitiveType INSERTAFTER
public static final PrimitiveType INSERTINTO
public static final PrimitiveType INSERTINTOLAST
public static final PrimitiveType INSERTATTR
public static final PrimitiveType INSERTINTOFIRST
public static final PrimitiveType REPLACEELEMCONT
public static final PrimitiveType REPLACEVALUE
public static final PrimitiveType RENAMENODE
public static final PrimitiveType PUT
public static final PrimitiveType REPLACENODE
public static final PrimitiveType DELETENODE
public static final PrimitiveType INSERTBEFORE
public static final PrimitiveType DBSTORE
public static final PrimitiveType DBRENAME
public static final PrimitiveType DBDELETE
public static final PrimitiveType DBOPTIMIZE
public static PrimitiveType[] values()
for (PrimitiveType c : PrimitiveType.values()) System.out.println(c);
public static PrimitiveType valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is null