public interface OXQConnection extends OXQDataFactory
javax.xml.xquery.XQConnection
.
Use method OXQView.getConnection(XQConnection)
to access these extensions. For example:
OXQDataSource ds = new OXQDataSource(); XQConnection con = ds.getConnection(); OXQConnection ocon = OXQView.getConnection(con); ...
Modifier and Type | Field and Description |
---|---|
static int |
SCOPE_CONNECTION
Identifies components associated with the connection instance
|
static int |
SCOPE_EXPRESSION
Identifies components associated with the expression instance
|
Modifier and Type | Method and Description |
---|---|
XQItem |
convertXQueryToXQueryX(OXQEntity query)
Converts XQuery to XQueryX.
|
void |
convertXQueryXToXQuery(OXQEntity query, java.io.OutputStream out, java.lang.String outEncoding)
Converts XQueryX to XQuery.
|
XQPreparedExpression |
copyExpression(XQPreparedExpression prepExpr)
Returns a copy of an
XQPreparedExpression instance. |
OXQAnnotation |
createAnnotation(javax.xml.namespace.QName name, XQSequence value)
Creates an annotation.
|
<T extends OXQEntityResolverFactory> |
createEntityResolverFactory(java.lang.Class<T> factoryType)
Returns a factory for creating instances of OXQEntityResolver.
|
OXQOptions |
createOptions()
Creates an empty instance of
OXQOptions . |
OXQSerializationParameters |
createSerializationParameters()
Creates an instance of
OXQSerializationParameters . |
OXQEntityLoader |
getEntityLoader(int scope)
Returns an OXQEntityLoader instance that controls the schema/module loading process.
|
OXQEntityResolver |
getEntityResolver()
Gets the entity resolver.
|
XQStaticContext |
getModuleStaticContext()
Gets an
XQStaticContext instance representing the default values for all properties of library modules loaded by this connection. |
XQConnection |
getXQView()
Returns the
XQConnection instance corresponding to this instance. |
XQPreparedExpression |
prepareExpression(OXQEntity xquery)
Prepares an expression for execution.
|
XQPreparedExpression |
prepareExpression(OXQEntity xquery, XQStaticContext properties)
Prepares an expression for execution.
|
void |
setEntityResolver(OXQEntityResolver entityResolver)
Assigns a new entity resolver to the connection, replacing the existing one.
|
void |
setModuleStaticContext(XQStaticContext properties)
Sets the default values for all properties of library modules loaded by this connection.
|
createItemFromBigDecimal, createItemFromBigInteger, createItemFromBinary, createItemFromCalendar, createItemFromDocument, createItemFromDuration, createItemFromQName, createSequence, createSequenceFromDocument, createSequenceFromDocument, createSequenceFromDocument, createSequenceFromDocument, createSequenceTypeFromJavaType
static final int SCOPE_CONNECTION
getEntityLoader(int)
, Constant Field Valuesstatic final int SCOPE_EXPRESSION
getEntityLoader(int)
, Constant Field ValuesXQConnection getXQView()
XQConnection
instance corresponding to this instance.getXQView
in interface OXQDataFactory
XQPreparedExpression prepareExpression(OXQEntity xquery) throws XQException
The properties of the connection's default XQStaticContext
instance are copied to the returned expression.
xquery
- the XQuery expression as an OXQEntity
. The permitted entity data
is the same as what is permitted for MODULE
entities except that collections are not allowed. Cannot be null
.XQException
- if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null
XQPreparedExpression prepareExpression(OXQEntity xquery, XQStaticContext properties) throws XQException
The properties of the specified XQStaticContext
instance are copied to the returned expression.
xquery
- the XQuery expression as an OXQEntity
. The permitted entity data
is the same as what is permitted for MODULE
entities except that collections are not allowed. Cannot be null
.properties
- XQStaticContext
containing values of expression properties.XQException
- if (1) the connection is in a closed state, or (2) the specified argument is null
XQPreparedExpression copyExpression(XQPreparedExpression prepExpr) throws XQException
XQPreparedExpression
instance. Users can create an initial prepared expression using the XQConnection
interface, and then make multiple copies using this method. The copying is done without plan recompilation, and each copy can then be executed concurrently in a separate thread. The copies do not support all the methods of OXQPreparedExpression
. The copies are primarily intended for binding variables and execution.prepExpr
- The input prepared expressionXQException
- if (1) the input prepared expression is closed, (2) the input prepared expression has already been executed or has bound variables (3) the input prepared expression was generated by some other XQJ implementation (4) the input prepared expression was created with a different connection (5) the input prepared expression cannot be copied or (6) there was an internal engine error while copying the input prepared expressionXQStaticContext getModuleStaticContext() throws XQException
XQStaticContext
instance representing the default values for all properties of library modules loaded by this connection. In order to modify the defaults, it is not sufficient to modify the values in the returned XQStaticContext
instance; in addition method setModuleStaticContext(XQStaticContext)
should be called to make the new values effective.XQStaticContext
instance representing the default values for all properties of library modulesXQException
- if the connection is in a closed statevoid setModuleStaticContext(XQStaticContext properties) throws XQException
XQStaticContext
instance and update its private copy. The OXQEntityResolver
implementation can override these defaults by providing OXQStaticContext
instance along with the returned library module content. See OXQEntity.PROPERTY_MODULE_STATIC_CONTEXT
for more information.properties
- a XQStaticContext
instance containing values of library module propertiesXQException
- if the connection is in a closed state<T extends OXQEntityResolverFactory> T createEntityResolverFactory(java.lang.Class<T> factoryType) throws XQException
factoryType
- The OXQEntityResolverFactory
implementation class to constructXQException
- if (1) the connection is in a closed state, (2) factory cannot be create for given factoryTypeOXQEntityResolverFactory
void setEntityResolver(OXQEntityResolver entityResolver) throws XQException
entityResolver
- the entity resolverXQException
- if the connection is in a closed stateOXQEntityResolver getEntityResolver() throws XQException
XQException
- if the connection is in a closed stateOXQEntityLoader getEntityLoader(int scope) throws XQException
The following entity loader instances are provided by each XQConnection:
OXQDataSource.IMPORT_SHARING
modeOXQEntityLoader
documentation for more information.scope
- SCOPE_CONNECTION
or SCOPE_EXPRESSION
XQException
- if the connection is in a closed stateXQItem convertXQueryToXQueryX(OXQEntity query) throws XQException
query
- an OXQEntity
instance representing the queryXQItem
instance.XQException
- if (1) the connection is closed, (2) a java IO exception was thrown while reading the query (attached as cause), or (3) the conversion failedOXQEntity.MEDIA_TYPE_XQUERY
, OXQEntityKind.MODULE
void convertXQueryXToXQuery(OXQEntity query, java.io.OutputStream out, java.lang.String outEncoding) throws XQException
query
- an OXQEntity
instance representing the query in XQueryXout
- the output stream to which the resulting XQuery is writtenoutEncoding
- a query encoding (UTF-8 if null
)XQException
- if (1) the connection is closed, (2) a java IO exception was thrown while reading the query (attached as cause), or (3) the conversion failedOXQEntity.MEDIA_TYPE_XQUERYX
, OXQEntityKind.MODULE
OXQSerializationParameters createSerializationParameters() throws XQException
OXQSerializationParameters
.XQException
- if the connection is in a closed stateOXQOptions createOptions() throws XQException
OXQOptions
.XQException
- if the connection is in a closed stateOXQAnnotation createAnnotation(javax.xml.namespace.QName name, XQSequence value) throws XQException
name
- the annotation name. Cannot be null
value
- the annotation value. Passing null
will set the value to the empty sequenceXQException
- if (1) the connection is closed, (2) the name parameter is null, or (3) consuming the value sequence raises an errorOXQStaticContext.declareFunction(QName, javax.xml.xquery.XQSequenceType[], javax.xml.xquery.XQSequenceType, OXQOptions, OXQAnnotation[])