Movatterモバイル変換


[0]ホーム

URL:


6 Query

A repository maysupportquery.

The structure andevaluation semantics of a query are defined by anabstract querymodel (AQM) for which two concrete language bindings arespecified:

The languages are bothdirect mappings of the AQM and are therefore equally expressive; anyquery expressed in one can be machine-transformed to the other.

Whether animplementation supports query can be determined by querying therepository descriptor table with the key

.

The returned arraycontains the constants representing the supported languages (see§24.2Repository Descriptors). If a repository supportsquery it must return at least the constants for the two JCR-definedlanguages,

and

,

indicating support forthose languages. In addition, a repository may support other querylanguages. These can be either additional language bindings to theAQM or completely independent of that model.

JCR 1.0 defines adialect of SQL different from JCR-SQL2, as well as a dialect ofXPath. Support for these languages is deprecated.

6.1 Optional Joins

Support forjoinsis optional beyond support for query itself. The extent of joinsupport can be determined by querying the repository descriptortable with the key

.

The value returnedwill be one of

6.2 Introduction to the Abstract Query Model

This sectionintroduces how queries are specified and evaluated in the AQM.

6.2.1 Selectors

A query has one ormoreselectors. When the query is evaluated, each selectorindependently selects a subset of the nodes in the workspace basedon node type.

In a repository thatdoes not supportjoins, a query will have only oneselector.

6.2.2 Joins

If the query has morethan one selector, it also has one or morejoins thattransform the sets of nodes selected by each selector into a singleset ofnode-tuples.

The membership of theset of node-tuples depends on thejoin type andjoincondition of each join. The join type can beinner,left-outer, orright-outer. The join condition cantest the equality of properties' values or the hierarchicalrelationship between nodes.

If the query hasnselectors, it hasn - 1 joins resulting in a set ofn-tuples.For example, if the query has two selectors, it will have one joinand produce a set of 2-tuples. If it has three selectors, it willhave two joins and produce a set of 3-tuples. If it has only oneselector, it will not have any joins and will produce a set of1-tuples, that is, the nodes selected by its only selector.

Support forjoinsis optional. In a repository thatdoes not supportjoins,the node-tuples produced are necessarily singletons. In other words,each node in the set produced by the (one and only) selector isconverted directly into a node-tuple of size one. All furtherprocessing within the query evaluation operates on these tuples justas it would on tuples of size greater than one.

6.2.3 Constraints

A query can specify aconstraint to filter the set of node-tuples by anycombination of:

6.2.4 Orderings

A query can specifyorderings to sort the filtered node-tuples by property value.

6.2.5 Query Results

The filtered andsorted node-tuples form thequery results. The query resultsare available in two formats:

6.3 Equality and Comparison

When testing forequality or order of two property values of the same type, the queryoperators conform to the definitions in §3.6.5Comparison ofValues.

When testing forequality or order of two property values of differing type, thequery operators perform standard property type conversion (see§3.6.4Property Type Conversion) and conform to standardvalue comparison (see §3.6.5Comparison of Values).

Support for equalityand order comparison ofvalues is not required.

6.4 Query Validity

To be successfullyevaluated and produce query results, a query must bevalid.

A query isinvalidif:

An invalid querycauses the repository to throw.Which method invocation throws this exception is implementationdetermined, but for an invalid query, the exception must be thrownno later than completion of the.

6.5 Search Scope

A querymustsearch the persistent workspace associated with the current session.Itmay take into account pending changes to the persistentworkspace; that is, changes which are either unsaved or, within atransaction, saved but uncommitted.

6.6 Notations

Three notations areused in the following sections: the AQM type grammar, the JCR-SQL2EBNF grammar and the JCR-JQOM Java API.

6.6.1 AQM Notation

The AQM is defined asa set of abstract types. The type grammar is written like this:




which means:

The typehas 4 attributes:

:mandatory, of type ,which is an enumeration with possible values,and.

:optional, of type

:a list of one or more items

:a list of zero or more items

The type is a subtype of .It inherits 'sattributes, and adds:

:mandatory, a string

6.6.2 JCR-SQL2 Notation

JCR–SQL2 is amapping of the AQM to a string serialization based on the SQLlanguage.

Each non-terminal inthe JCR-SQL2 EBNF grammar corresponds to the type of the same namein the AQM grammar. The semantics of each JCR-SQL2 production isdescribed by reference to the semantics of the corresponding AQMproduction. The two grammars are, however, entirely distinct andself- contained. Care should be taken not to mix productions fromone grammar with those of the other.

The JCR-SQL2 grammaris written like this:










6.6.2.1 String Literals in JCR-SQL2 Grammar

Throughout thissection string literals that appear in the syntactic grammardefining JCR-SQL2 must be interpreted as specified in §1.3.1StringLiterals in Syntactic Grammars except that each character in thestring literal must be interpreted as representing both upper andlower case versions. In other words, implementations must becase-insensitive with regard to JCR-SQL2.

6.6.3 JCR-JQOM Notation

JCR-JQOM is a mappingof the AQM to a Java API.

Each method andparameter name of the JCR-JQOM Java API corresponds to the type ofthe same name in the AQM grammar. The semantics of each JCR-JQOMmethod is described by reference to the semantics of thecorresponding AQM production.

A JCR-JQOM query isbuilt by assembling objects created using the factory methods of.

For each AQM type, thefollowing are listed:

Unless otherwiseindicated, the Java interfaces listed in this section are in thepackage.

6.7 Abstract Query Model and Language Bindings

The following sectiondescribes the AQM grammar and its mapping to JCR-SQL2 and JCR-JQOM.For each AQM production, a description of its semantics is provided,followed by the corresponding JCR-SQL2 production and thecorresponding JCR-JQOM methods.

For queries with onlyone selector the JCR-SQL2 syntax permits the selector name to beomitted. In such cases the implementation must automaticallygenerate a selector name for internal use. If the resulting query islater examined through the JCR-JQOM API, the automatically producedselector name will be seen.

6.7.1 Query

AQM


Aconsists of:

JCR-SQL2


JCR-JQOM

A query is representedby aobject, created with:

extendsand declares:

6.7.2 Source

AQM


Evaluates to a set ofnode-tuples.

JCR-SQL2


JCR-JQOM

is an empty interface with subclassesand.

6.7.3 Selector

AQM


Selects a subset ofthe nodes in the workspace based on node type.

The query is invalidifrefers to a node type that has aqueryable node typeattribute of(see §3.7.1.5Queryable Node Type). Otherwise, if thequeryable node type attribute is true, the following holds:

A selector selectsevery node in the workspace, subject to access control constraints,that satisfies at least one of the following conditions:

A selector has athat can be used elsewhere in the query to identify the selector.

The query isinvalidifis identical to theof another selector in the query.

The query is alsoinvalid if is not a valid JCR name or is a valid JCR name but not the name of anode type available in the repository.

JCR-SQL2



JCR-JQOM

Ais created with:

extendsand declares:

6.7.4 Name

AQM


A JCR name.

The query isinvalidif the name does not satisfy either theproduction in §3.2.5.1Expanded Form or theproduction in §3.2.5.2Qualified Form.

JCR-SQL2




JCR-JQOM

A JCR name inform (either qualified or expanded).

6.7.5 Join

Support forjoinsis optional.

AQM


Performs a joinbetween two node-tuple sources.

Ifevaluates toL, a set ofm-tuples, andevaluates toR, a set ofn-tuples, then the joinevaluates toJ, a set of (m + n)-tuples. The membersofJdepend on theand.

LetL xRbe the Cartesian product ofL andR as a set of (m+ n)-tuples

LxR = { ℓr: ℓL,rR}

andc(A)be the selection overA of its members satisfyingc

c(A)= { a : aA,c(a)}

Then ifis:

J=c(LxR)

Otherwise, ifis:

J =c(LxR)(LL(c(LxR)))

whereL(c(LxR)) is the projection of them-tuples contributed byL from the(m + n)-tuples ofc(LxR).

Otherwise, ifis:

J =c(LxR)(RR(c(LxR)))

whereR(c(LxR)) is the projection of then-tuples contributed byR from the(m + n)-tuples ofc(LxR).

The query isinvalidifis the same source as.

JCR-SQL2




JCR-JQOM

Ais created with:

extendsand declares:

6.7.6 JoinType

Support forjoinsis optional.

AQM


JCR-SQL2





JCR-JQOM

A join type is aconstant. One of:

6.7.7 JoinCondition

Support forjoinsis optional.

AQM


Filters the set ofnode-tuples formed from a join.

JCR-SQL2


JCR-JQOM

is an empty interface with subclasses,,and.

6.7.8 EquiJoinCondition

Support forjoinsis optional.

AQM


Tests whether the value of a propertyin a first selector is equal to the value of a property in a secondselector.

A node-tuple satisfies the constraintonly if:

The query isinvalid if

JCR-SQL2






JCR-JQOM

Anis created with:

extends and declares:

6.7.9 SameNodeJoinCondition

Support forjoinsis optional.

AQM


Tests whether two nodes are “thesame” according to themethod.

Ifis omitted:

would return ,whereis the node for the selectorandis the node for the selector.

Otherwise, ifis specified:

would return,whereis the node for the selectorandis the node for the selector.

The query isinvalid if:

JCR-SQL2



JCR-JQOM

Ais created with:

extendsand declares:

6.7.10 ChildNodeJoinCondition

Support forjoinsis optional.

AQM


Tests whether thenode is a child of thenode. A node-tuple satisfies the constraint only if:

would return ,whereis the node for the selectorandis the node for the selector.

The query isinvalid if:

JCR-SQL2




JCR-JQOM

Ais created with:

extendsand declares:

6.7.11 DescendantNodeJoinCondition

Support forjoinsis optional.

AQM


Tests whether thenode is a descendant of thenode. A node-tuple satisfies the constraint only if:

would returnfor some non-negative integer,whereis the node for the selectorandis the node for the selector.

The query isinvalid if:

JCR-SQL2




JCR-JQOM

Ais created with:

extendsand declares:

6.7.12 Constraint

AQM


Filters the set of node-tuples formedby evaluating the query's selectors and the joins between them.

To be included in the query results, anode-tuple must satisfy the constraint.

JCR-SQL2


In JCR-SQL2, thefollowing precedence classes apply, in order of evaluation:

Class

ConstraintProduction

JCR-SQL2 Syntax

1

(grouping with parentheses)

2

,,,,,,

3

4

5



JCR-JQOM

is an empty interface with subclasses,,,,,,,and.

6.7.13 And

AQM


Performs a logical conjunction of twoother constraints.

To satisfy the constraint, a node-tuple must satisfy both and .

JCR-SQL2




JCR-JQOM

Anis created with:

extendsand declares:

6.7.14 Or

AQM


Performs a logical disjunction of twoother constraints.

To satisfy the constraint, the node-tuple must either:

JCR-SQL2


JCR-JQOM

Anis created with:

extendsand declares:

6.7.15 Not

AQM


Performs a logical negation of anotherconstraint.

To satisfy the constraint, the node-tuple mustnot satisfy .

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.16 Comparison

AQM


Filters node-tuples based on theoutcome of a binary operation.

For any comparison, always evaluates to a scalar value. In contrast, may evaluate to an array of values (for example, the values of amulti-valued property), in which case the comparison is separatelyperformed for each element of the array, and the constraint is satisfied as a whole if the comparison againstanyelement of the array is satisfied.

If and evaluate to values of different property types, the value ofis converted to the property type of the value of as described in §3.6.4 Property Type Conversion. If the typeconversion fails, the query isinvalid.

Given an operatorand a property instanceof property type,can be compared usingonly if:

If is not supported for the property type of ,the query isinvalid.

If evaluates to (for example, if the operand evaluates the value of a property whichdoes not exist), the constraint is not satisfied.

The operator is satisfiedonly if the value ofis equal to the value of ,as described in §3.6.5Comparison of Values.

The operator is satisfiedunless the value ofis equal tothe value of ,as described in §3.6.5Comparison of Values.

The operator is satisfiedonly if the value ofis orderedbefore the value of ,as described in §3.6.5Comparison of Values.

The operator is satisfiedunless the value ofis orderedafter the value of ,as described in §3.6.5Comparison of Values.

The operator is satisfiedonly if the value ofis orderedafter the value of ,as described in §3.6.5Comparison of Values.

The operator is satisfiedunless the value ofis orderedbefore the value of ,as described in §3.6.5Comparison of Values.

The operator is satisfiedonly if the value ofmatches the pattern specified by the value of ,where in the pattern:

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.17 Operator

AQM


JCR-SQL2









JCR-JQOM

An operator is aconstant. One of:

6.7.18 PropertyExistence

AQM


Tests the existence of a property.

A node-tuple satisfies the constraintif the node has a property named .

The query isinvalid ifis not the name of a selector in the query.

JCR-SQL2



JCR-JQOM

Ais created with:

extendsand declares:

6.7.19 FullTextSearch

AQM


Performs a full-text search.

The full-text search expression isevaluated against the set of full-text indexed properties within thefull-text search scope. If is specified, the full-text search scope is the property of thatname on the node in the node-tuple; otherwise the full-text search scope isimplementation determined.

Whether a particular property isfull-text indexed can be determined by thefull-text searchableattribute of its property definition (see §3.7.3.4Full-TextSearchable).

It is implementation-determinedwhether is independently evaluated against each full-text indexed propertyin the full-text search scope, or collectively evaluated against theset of such properties using some implementation-determinedmechanism.

Similarly, for multi-valuedproperties, it is implementation-determined whetheris independently evaluated against each element in the array ofvalues, or collectively evaluated against the array of values usingsome implementation-determined mechanism.

Theis a,meaning that it may be either a literal JCR value or a boundvariable (which evaluates to a JCR value). The value must be a(or convertible to a)that conforms to the following grammar:















U+0020 */





A query satisfies a constraint if the value (or values) of the full-text indexedproperties within the full-text search scope satisfy the specified,evaluated as follows:

The query isinvalid if:

The grammar and semantics describedabove defines theminimal requirement, meaning that anysearch string accepted as valid by an implementation must conform tothis grammar. An implementation may, however, restrict acceptablesearch strings further by augmenting this grammar and expanding thesemantics appropriately.

If is specified but, for a node-tuple, the node does not have a property named ,the query isvalid but the constraint is not satisfied.

JCR-SQL2



JCR-JQOM

Ais created with:

extendsand declares:

6.7.20 SameNode

AQM


Tests whether the node is reachable by the absolute path specified. A node-tuplesatisfies the constraint only if:

would return ,where is the node for the specified selector.

The query isinvalid if:

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.21 ChildNode

AQM


Tests whether the node is a child of a node reachable by the absolute path specified.A node-tuple satisfies the constraint only if:

would return ,where is the node for the specified selector.

The query isinvalid if:

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.22 DescendantNode

AQM


Tests whether the node is a descendant of a node reachable by the absolute pathspecified. A node-tuple satisfies the constraint only if:

would return for some non-negative integer ,where is the node for the specified selector.

The query isinvalid if:

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.23 Path

AQM


A JCR path.

JCR-SQL2




JCR-JQOM

A JCR path in stringform (standard, non-standard, normalizedor non-normalized, see §3.3.5Standard and Non-Standard Formand §3.3.6.3Normalized Paths).

6.7.24 Operand

AQM


JCR-SQL2


JCR-JQOM

is an empty interface with subclassesand.

6.7.25 StaticOperand

AQM


An operand whose value can bedetermined from static analysis of the query, prior to itsevaluation.

JCR-SQL2


JCR-JQOM

is an empty interface with subclassesand.

6.7.26 DynamicOperand

AQM


An operand whose value can only bedetermined in evaluating the query.

JCR-SQL2


JCR-JQOM

is an empty interface with subclasses,,,,,and.

6.7.27 PropertyValue

AQM


Evaluates to the value (or values, ifmulti-valued) of a property.

If, for a node-tuple, the node does not have a property named ,the operand evaluates to .

The query isinvalid ifis not the name of a selector in the query.

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.28 Length

AQM


Evaluates to the length (or lengths,if multi-valued) of a property. In evaluating this operand, arepositoryshould use the semantics defined in §3.6.7Lengthof a Value.

If evaluates to ,the operand also evaluates to .

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.29 NodeName

AQM


Evaluates to a value equal to theJCR name of a node.

The query isinvalid ifis not the name of a selector in the query.

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.30 NodeLocalName

AQM


Evaluates to a value equal to theJCR local name of a node.

The query isinvalid ifis not the name of a selector in the query.

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.31 FullTextSearchScore

AQM


Evaluates to a value equal to the full-text search score of a node.

Full-text search score ranks aselector's nodes by their relevance to the specified in a .The values to which evaluates and the interpretation of those values are implementationspecific. may evaluate to a constant value in a repository that does notsupport full-text search scoring or has no full-text indexedproperties.

The query isinvalid ifis not the name of a selector in the query.

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.32 LowerCase

AQM


Evaluates to the lower-case stringvalue (or values, if multi-valued) of .

If does not evaluate to a string value, its value is first converted toa string as described in §3.6.4Property Type Conversion.The lower-case string value is computed as though the method of were called.

If evaluates to ,the operand also evaluates to .

JCR-SQL2


JCR-JQOM

Ais created with:

extendsand declares:

6.7.33 UpperCase

AQM

Evaluates to the upper-case stringvalue (or values, if multi-valued) of .

If does not evaluate to a string value, its value is first converted toa string as described in §3.6.4Property Type Conversion.The upper-case string value is computed as though the method of were called.

If evaluates to ,the operand also evaluates to .

JCR-SQL2


JCR-JQOM

Anis created with:

extendsand declares:

6.7.34 Literal

AQM


A JCR value.

JCR-SQL2






Anmay be interpreted as aof property typeor some other type inferred from static analysis. A,on the other hand, is interpreted as the string form of aof theindicated.

JCR-JQOM

A JCR.Aobject can be created using(see §6.10Literal Values). Note that unlike in the case ofJCR-SQL2, property type information is intrinsic to theobject, so no equivalent of thefunction is needed in JCR-JQOM.

6.7.35 BindVariable

AQM


Evaluates to the value of a bindvariable.

The query isinvalid if novalue is bound to .

JCR-SQL2



JCR-JQOM

Ais created with:

extendsand declares:

6.7.36 Prefix

AQM


A JCR prefix.

The query isinvalid if theprefix does not satisfy the production in §3.2.5.2Qualified Form.

JCR-SQL2


JCR-JQOM

A string that conformsto the JCR Name prefix syntax. This is not required to be an actualprefix in use in the repository. The prefix syntax is used simply tocharacterize the range of possible variables.

6.7.37 Ordering

AQM


Determines the relative order of twonode-tuples by evaluating for each.

For a first node-tuple, ,for which evaluates to ,and a second node-tuple, ,for which evaluates to :

If operand is a(see §6.7.27PropertyValue) of a propertyand thequery-orderable attribute of the property definitionofis(see §3.7.3.5Query-Orderable) then the relative order ofand is implementation determined, otherwise, if thequery-orderableattribute is,then:

If is ,then:

Otherwise, ifis ,then:

The query isinvalid if does not evaluate to a scalar value.

JCR-SQL2



Ifis omitted in the JCR-SQL2 statement the default is(see §6.7.38Order).

JCR-JQOM

An ascendingis created with:

A descendingis created with:

declares:

6.7.38 Order

AQM


is eitheror.

JCR-SQL2




JCR-JQOM

An order is aconstant. One of:

6.7.39 Column

AQM


Defines a column to include in thetabular view of query results.

If is not specified, a column is included for each single-valuednon-residual property of the node type specified by the attribute of the selector .

If is specified, is required and used to name the column in the tabular results. Ifis not specified, must not be specified, and the included columns will be named“”.

The query isinvalid if:

If is specified but, for a node-tuple, the node does not have a property named ,the query isvalid and the column has value.

JCR-SQL2






JCR-JQOM

Ais created with:

declares:

6.8 QueryManager

The query function isaccessed through theobject, acquired through

.

6.8.1 Supported Languages

returns an array ofstrings representing the supported query languages. In allrepositories that support query, the array will contain at least thestring constants

and

.

Any additionallanguages also supported will also be listed in the returned array.

6.9 Query Object

A newobject can be created with

.

Theparameter is a string representing one of the supported languages.Theparameter is the query statement itself. This method is used forlanguages that are string-based (i.e., most languages, such asJCR-SQL2) as well as for the string serializations ofnon-string-based languages (such as JCR-JQOM). For example, the call

,

whereis theandis a JCR-SQL2 statement, returns aobject encapsulating.

However, the call

also works. It returnsa(a subclass of)holding the JCR-JQOM object tree equivalent to.

In either case thereturnedobject encapsulates the resulting query. In some repositories thefirst method call (with JCR-SQL2 specified) may also result in a,though this is not required.

6.9.1 QueryObjectModelFactory

Toprogrammatically build a query tree using JCR-JQOM the user acquiresausing

.

The user then buildsthe query tree using the factory methods of,ultimately resulting in aobject (a subclass ofrepresenting the query.

6.9.1.1 Serialized Query Object Model

The JCR-SQL2 language,in addition to being a query language in its own right is also thestandard serialization of a valid JCR-JQOM object tree. Since thetwo languages are formally equivalent they can always beroundtripped.

6.9.2 Getting the Statement

returns the statementset for the query. If thewas created with an explicitly suppliedstring parameter usingthen this method returns that statement. The statement returned mustbe semantically identical to the original statement but need not bean identical string (for example, it may be normalized).

If theis actually acreated withthenmust return the serialized form of the query, in JCR-SQL2 syntax.

6.9.3 Getting the Language

returns the languagein which the query is specified. If thewas created with an explicitly suppliedstring parameter usingthen this method returns that string.

If theis actually acreated withthenwill return the string constant.

6.9.4 Query Limit

Sets the maximum sizeof the result set, expressed in terms of the number ofs,as found in the table-view of the(see §6.11QueryResult).

6.9.5 Query Offset

Sets the offset withinthe full result set at which the returned result set should start,expressed in terms of the number ofsto skip, as found in the table-view of the(see §6.11QueryResult).

6.9.6 Bind Variables

A querymay contain variables.

bindsto the variable.

InJCR-SQL2 a bind variable is indicated by a leading dollar-sign. InJCR-JQOM it is a QOM object created with the(see §6.7.35BindVariable).

Themethod

returns the names ofthe bind variables in the query. If the query does not contains anybind variables then an empty array is returned.

6.9.7 Stored Query

When a newobject is first created it is atransient query. If therepository supports the node type,then a transient query can be stored in content by calling

.

This creates annode at the specified path. Ais required to persist the node.

6.9.7.1 nt:query

Thenode type is defined as follows:

holds the string returned by.

holds the string returned by.

If the language ofthis query is JCR-JQOM,will hold the JCR-SQL2 serialization of the JCR-JQOM object tree andwill return that string. Also, since the original query wasconstructed using JCR-JQOM,records the language as “”andreturns “”.

6.9.7.2 Stored Query Path

returns the absolutepath of athat has been stored as a node.

6.9.7.3 Retrieving a Stored Query

retrieves a previouslypersisted query and instantiates it as aobject.

6.9.7.4 Namespace Fragility

Note that the querystatement stored within a stored query (the value of the property)is stored as a simple string. Therefore, if it contains qualifiedJCR names it will benamespace-fragile. If the stored queryis run in a context where a prefix used maps to a differentnamespace than it did upon creation then the query will notreproduce the original result. To mitigate this, users shouldeither,

6.10 Literal Values

Whencreating aobject (see 6.7.16Comparison)a user may wish to pass a literal property value (see 6.7.34Literal)in the form of aobject.objects are created using theacquired through

.

(see§10.4.3Creating Value Objects).

6.11 QueryResult

Once a query has beendefined, it can be executed. The method

returns the aobject. Theis returned in two formats: as a table and as a list of nodes.

6.11.1 Table View

The table view of aresult is accessed with

The returnedholds a series ofobjects. Aobject represents a single row of the query result table whichcorresponds to a node-tuple returned by the query.

6.11.1.1 Row

Upon retrieving anindividual,the set ofsmaking up that row can be retrieved with

The values arereturned in that same order as their corresponding column names arereturned by.

returns theof the indicated column of the.The names of the columns can be retrieved with

.

In queries with onlyone selector included among the specified columns, eachcorresponds to a single.In such cases

returns that.

In queries with morethan one selector included among the specified columns, a particularselector must be indicated in order to retrieve its corresponding. This is done using

.

The available selectornames can be retrieved with

.

If theis from a result involving outer joins, it may have nocorresponding to the specified selector, in which case this methodreturns.

The methods

are equivalent toand
, respectively.However, some implementations may be able gain efficiency by notresolving the actual.

The method

returns the full textsearch score for this row that is associated with the specifiedselector. This is equivalent to the score of theassociated with that thisand that selector.

If noAQM object (see §6.7.31FullTextSearchScore) is associatedwith the specified selector this method will still return a valuebut that value may not be meaningful or may simply reflect theminimum possible relevance level (for example, in some systems thismight be a score of 0).

If thisis from a result involving outer joins, it may have nocorresponding to the specified selector, in which case this methodreturns an implementation selected value, as it would if there werenoassociated with the selector.

The method

works identically to, but only in cases wherethere is exactly one selector and therefore its name need not beexplicitly specified.

6.11.2 Node View

Forqueries with only one selector

returnsan iterator over all matching nodes in the order specified by thequery. For queries with more than one selector the order in whichnodes are returned is implementation-specific.

6.12 Query Scope

Eachis bound to aobject via thethrough which it was created and theobject through which thatwas acquired. Through its associatedandobjects a query is therefore bound to a single persistent workspaceand a single transient store.

6.12.1 Access Restrictions

A query result alwaysrespects the access restrictions of its bound.This includes all restrictions, as reflected in thecapabilitiesof the,which encompassesprivileges,permissions andotherrestrictions (see §9Permissions and Capabilities).

In general, if thebounddoes not have read access to a particular item, then that item willnot be included in the result set even if it would otherwiseconstitute a match.

6.12.2 Queryable Content

A query runs againsteither

The choice of whichscope to use is an implementation-variant.

6.12.3 Query Result Items

Regardless of whichscope is used, when an item is accessed from within aobject, the state of the item returned will obey the same semanticsas if it were retrieved using a normalor:the item state will reflect any pending changes in transient storeof the.As a result, it is possible that an item returned as a match willnot reflect the state that caused it tobe a match (i.e., itspersistent state). Applications can clear the(either throughor)before running a query in order to avoid such discrepancies.


[8]ページ先頭

©2009-2025 Movatter.jp