public interface TXMLObjectAccessor extends TAccessor
Modifier and Type | Method and Description |
---|---|
TResponse |
close(TPreparedXQuery pQuery)
Removes prepared XQuery.
|
TResponse |
delete(TQuery query)
Deletes a set of XML documents specified by the query expression.
|
TResponse |
delete(TXMLObject xmlObject)
Deletes the XML document represented by the TXMLObject instance in the Tamino database.
|
TScroll |
getScrollType()
Gets the scroll type.
|
TResponse |
insert(TXMLObject xmlObject)
Inserts the XML document represented by the TXMLObject instance
into the Tamino database.
|
TResponse |
query(TQuery query)
Queries Tamino to retrieve a set of XML documents that satisfies
the query expression.
|
TResponse |
query(TQuery query,
int quantity)
Queries Tamino to retrieve a set of XML documents that satisfies
the query expression.
|
TXMLObject |
retrieve(TXMLObject xmlObject)
Retrieves a single XML document from Tamino.
|
TStreamHeader |
retrieveHeader(TXMLObject xmlObject)
Just retrieves the ´meta´ data of a single document from Tamino.
|
void |
setScrollType(TScroll scroll)
Sets the scroll type ('yes' or 'no').
|
TResponse |
update(TXMLObject xmlObject)
Updates the XML document represented by the TXMLObject instance in
the Tamino database.
|
TResponse |
xquery(TPreparedXQuery xquery)
Queries Tamino to retrieve a set of XML documents that satisfies
the prepared xquery expression.
|
TResponse |
xquery(TPreparedXQuery xquery,
int quantity)
Queries Tamino to retrieve a set of XML documents that satisfies
the prepared xquery expression.
|
TResponse |
xquery(TXQuery xquery)
Queries Tamino to retrieve a set of XML documents that satisfies
the xquery expression.
|
TResponse |
xquery(TXQuery xquery,
int quantity)
Queries Tamino to retrieve a set of XML documents that satisfies
the xquery expression.
|
cancelRequests, getAccessLocation, getApplicationName, getCanBeCancelled, getLockMode, getLockwaitMode, getMaximumRequestDuration, setAccessLocation, setApplicationName, setCanBeCancelled, setLockMode, setLockwaitMode, setMaximumRequestDuration
invalidate
TResponse insert(TXMLObject xmlObject) throws TInsertException
The following characterizes this behavior:
!xmlObject.hasDocname() | Insert. |
xmlObject.hasDocname() | Insert, if a document with the given ino:docname does not exist. |
xmlObject.hasDocname() | Update, if a document with the given ino:docname already exists. |
xmlObject
- the representation of the XML document that should be stored in Tamino.TInsertException
- signals an error while attempting the insert operation.TResponse update(TXMLObject xmlObject) throws TUpdateException
If an update is done based on an id and the XML object being updated had a docname, the docname is deleted, i.e. the XML object no longer has a docname after the update operation.
If the TXMLObject instance carries no id and no XML object exists with the same docname a new object will be inserted, otherwise the object will be replaced.
The following characterizes this behavior:
xmlObject.hasId() | Update, if the document with the given id exists. |
xmlObject.hasId() | Insert, if the document with the given id does not exist. |
!xmlObject.hasId() && xmlObject.hasDocname() | Update, if the document with the given docname exists. |
!xmlObject.hasId() && xmlObject.hasDocname() | Insert, if the document with the given docname does not exist. |
xmlObject
- the representation of the XML document to be updated in Tamino.TUpdateException
- signals an error while attempting the update operation.TResponse delete(TXMLObject xmlObject) throws TDeleteException
xmlObject
- the representation of the XML document to be deleted from Tamino.TDeleteException
- signals an error while attempting the delete operation.TResponse delete(TQuery query) throws TDeleteException
query
- query expression which specifies a set of XML documents to be deleted.TDeleteException
- signals an error while attempting the delete operation.TResponse query(TQuery query) throws TQueryException
query
- query expression which specifies a set of XML documents to be retrieved.TQueryException
- signals an error while attempting the query operation.TResponse xquery(TXQuery xquery) throws TXQueryException
This feature requires Tamino 4.1
xquery
- query expression which specifies a set of XML documents to be retrieved.TXQueryException
- signals an error while attempting the query operation.TResponse xquery(TPreparedXQuery xquery) throws TXQueryException
This feature requires Tamino 4.4
xquery
- prepared query expression which specifies a set of XML documents to be retrieved.TXQueryException
- signals an error while attempting the query operation.TResponse xquery(TPreparedXQuery xquery, int quantity) throws TXQueryException
This feature requires Tamino 4.4
xquery
- prepared query expression which specifies a set of XML documents to be retrieved.quantity
- the number of documents to be retrieved in each step.TXQueryException
- signals an error while attempting the query operation.TResponse query(TQuery query, int quantity) throws TQueryException
Please note, this operation can only be used in a local transaction mode. This is due to the fact that it makes use of a Tamino cursor which can only be used in a transactional context. The obtained result set is only available while the current local transaction is open. A commit, rollback or change of the transaction mode will terminate the transaction and invalidate the TXMLObjectIterator.
This feature requires Tamino 3.1
query
- query expression which specifies a set of XML documents to be retrieved.quantity
- the number of documents to be retrieved in each step.TQueryException
- signals an error while attempting the query operation.TResponse xquery(TXQuery xquery, int quantity) throws TXQueryException
Please note, this operation can only be used in a local transaction mode. This is due to the fact that it makes use of a Tamino cursor which can only be used in a transactional context. The obtained result set is only available while the current local transaction is open. A commit, rollback or change of the transaction mode will terminate the transaction and invalidate the TXMLObjectIterator. The Tamino cursor mentioned above is realized as an insensitive scrollable cursor. Please refer to the description of the XQuery cursor in the Tamino Server documentation for details.
This feature requires Tamino 4.1
xquery
- query expression which specifies a set of XML documents to be retrieved.quantity
- the number of documents to be retrieved in each step.TXQueryException
- signals an error while attempting the query operation.TXMLObject retrieve(TXMLObject xmlObject) throws TRetrieveException
Retrieves a single XML document from Tamino. The document is retrieved by its docname or id as set in the TXMLObject instance passed as input parameter and not by a query expression. If both docname and id are present in the TXMLObject instance, the docname is used.
The document returned is in principle the same as the document contained in the result set returned by a query expression of the following format:
<Root>/[ino:id=<id>] <Root>/[ino:docname=<docname>]
There is a number of differences between the XML document as returned by one of these queries and the XML document as returned by the retrieve method. The retrieve method returns the XML document as it was originally stored in Tamino complete with XML meta-information like prologue information. In detail the differences are:
The TXMLObject instance returned is the same instance passed as the input parameter; no new instance is created. This may cause side effects in the following situation: In case both id and docname are set in the input TXMLObject instance, and the XML document is therefore retrieved using the docname attribute, the id returned by the getId method of the TXMLObject instance may not reflect the actual id of the XML document. This is because the id and docname attributes are not returned by Tamino when using the the single document retrieve method. The docname is obviously correct as it was used to retrieve the XML document in the first place. Note that if a TXMLObject instance retrieved via the retrieve method is subsequently used for an update, the update logic prefers the id over the docname.
xmlObject
- a TXMLObject instance specifying by its doctype, id or docname information
which XML document to retrieve from Tamino.TRetrieveException
- signals an error while attempting the retrieve operation.TStreamHeader retrieveHeader(TXMLObject xmlObject) throws TRetrieveException
Just retrieves the ´meta´ data of a single document from Tamino. This data is retrieved by its docname or id as set in the TXMLObject instance passed as input parameter and not by a query expression. If both docname and id are present in the TXMLObject instance, the docname is used.
This method behaves like the retrieve()
method except that
it does not retieve the whole document but only its ´meta´ data, which is
contained in the TStreamHeader
.
xmlObject
- a TXMLObject instance specifying by its doctype, id or docname information
which document to retrieve from Tamino.TRetrieveException
- signals an error while attempting the retrieve operation.com.softwareag.tamino.db.api.accessor.TStreamAccessor#retrieve(TXMLObject)
void setScrollType(TScroll scroll)
scroll
- - specifies whether cursor is scrollable or not.TScroll getScrollType()
TResponse close(TPreparedXQuery pQuery) throws TXQueryException
pQuery
- is the Prepared XQuery to be removed.TXQueryException
- due to access problems.Copyright (c) 2017 Software AG. All Rights Reserved.