phpcr-utils/src/PHPCR/Util/QOM/BaseQomToSqlQueryConverter.php

Show: PublicProtectedPrivateinherited
Table of Contents
This file is part of the PHPCR Utils

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

License
Apache Software License 2.0  
Link
http://phpcr.github.com/  

\PHPCR\Util\QOM\BaseQomToSqlQueryConverter

Package: Default
Common base class for the SQL(1) and SQL2 converters
Children
\PHPCR\Util\QOM\QomToSql2QueryConverter
\PHPCR\Util\QOM\QomToSql1QueryConverter

Properties

>VPropertyprotected\PHPCR\Util\QOM\BaseSqlGenerator $generator
The generator to use

Methods

methodpublic__construct(\PHPCR\Util\QOM\BaseSqlGenerator $generator) : void

Instantiate the converter

Parameters
NameTypeDescription
$generator\PHPCR\Util\QOM\BaseSqlGenerator
methodpublicconvert(\PHPCR\Query\QOM\QueryObjectModelInterface $query) : string

Query ::= 'SELECT' columns 'FROM' Source ['WHERE' Constraint] ['ORDER BY' orderings]

Parameters
NameTypeDescription
$query\PHPCR\Query\QOM\QueryObjectModelInterface
Returns
TypeDescription
string
methodprotectedconvertBindVariable(string $var) : string

BindVariableValue ::= '$'bindVariableName bindVariableName ::= Prefix

Parameters
NameTypeDescription
$varstring
Returns
TypeDescription
string
methodprotectedconvertColumns(\PHPCR\Query\QOM\ColumnInterface[] $columns) : string

columns ::= (Column ',' {Column}) | '*' Column ::= ([selectorName'.']propertyName ['AS' columnName]) | (selectorName'.*') // If only one selector exists selectorName ::= Name propertyName ::= Name columnName ::= Name

Parameters
NameTypeDescription
$columns\PHPCR\Query\QOM\ColumnInterface[]
Returns
TypeDescription
string
methodprotectedconvertComparison(\PHPCR\Query\QOM\ComparisonInterface $comparison) : string

Comparison ::= DynamicOperand Operator StaticOperand

Operator ::= EqualTo | NotEqualTo | LessThan | LessThanOrEqualTo | GreaterThan | GreaterThanOrEqualTo | Like EqualTo ::= '=' NotEqualTo ::= '<>' LessThan ::= '<' LessThanOrEqualTo ::= '<=' GreaterThan ::= '>' GreaterThanOrEqualTo ::= '>=' Like ::= 'LIKE'

Parameters
NameTypeDescription
$comparison\PHPCR\Query\QOM\ComparisonInterface
Returns
TypeDescription
string
methodprotectedconvertConstraint(\PHPCR\Query\QOM\ConstraintInterface $constraint) : string
abstract

Convert a constraint.

This is different between SQL1 and SQL2.

Parameters
NameTypeDescription
$constraint\PHPCR\Query\QOM\ConstraintInterface
Returns
TypeDescription
string
methodprotectedconvertDynamicOperand(\PHPCR\Query\QOM\DynamicOperandInterface $operand) : mixed
abstract

Convert dynamic operand.

This is different between SQL1 and SQL2.

Parameters
NameTypeDescription
$operand\PHPCR\Query\QOM\DynamicOperandInterface
Returns
TypeDescription
mixed
methodprotectedconvertFullTextSearch(\PHPCR\Query\QOM\FullTextSearchInterface $constraint) : string

FullTextSearch ::= 'CONTAINS(' ([selectorName'.']propertyName | selectorName'.*') ',' FullTextSearchExpression ')' // If only one selector exists in this query, explicit specification of the selectorName preceding the propertyName is optional

Parameters
NameTypeDescription
$constraint\PHPCR\Query\QOM\FullTextSearchInterface
Returns
TypeDescription
string
methodprotectedconvertFullTextSearchExpression(string $expr) : string

FullTextSearchExpression ::= BindVariable | ''' FullTextSearchLiteral '''

Parameters
NameTypeDescription
$exprstring
Returns
TypeDescription
string
methodprotectedconvertLiteral(mixed $literal) : string

Literal ::= CastLiteral | UncastLiteral

Parameters
NameTypeDescription
$literalmixed
Returns
TypeDescription
string
methodprotectedconvertOrderings(\PHPCR\Query\QOM\OrderingInterface[] $orderings) : string

orderings ::= Ordering {',' Ordering} Ordering ::= DynamicOperand [Order] Order ::= Ascending | Descending Ascending ::= 'ASC' Descending ::= 'DESC'

Parameters
NameTypeDescription
$orderings\PHPCR\Query\QOM\OrderingInterface[]
Returns
TypeDescription
string
methodprotectedconvertPath(string $path) : string

Path ::= '[' quotedPath ']' | '[' simplePath ']' | simplePath quotedPath ::= A JCR Path that contains non-SQL-legal characters simplePath ::= A JCR Name that contains only SQL-legal characters

Parameters
NameTypeDescription
$pathstring
Returns
TypeDescription
string
methodprotectedconvertPropertyExistence(\PHPCR\Query\QOM\PropertyExistenceInterface $constraint) : string

PropertyExistence ::= selectorName'.'propertyName 'IS NOT NULL' | propertyName 'IS NOT NULL' If only one selector exists in this query

Note: The negation, 'NOT x IS NOT NULL' can be written 'x IS NULL'

Parameters
NameTypeDescription
$constraint\PHPCR\Query\QOM\PropertyExistenceInterface
Returns
TypeDescription
string
methodprotectedconvertPropertyValue(\PHPCR\Query\QOM\PropertyValueInterface $value) : string

PropertyValue ::= [selectorName'.'] propertyName // If only one selector exists

Parameters
NameTypeDescription
$value\PHPCR\Query\QOM\PropertyValueInterface
Returns
TypeDescription
string
methodprotectedconvertSelector(\PHPCR\Query\QOM\SelectorInterface $selector) : string

Selector ::= nodeTypeName ['AS' selectorName] nodeTypeName ::= Name

Parameters
NameTypeDescription
$selector\PHPCR\Query\QOM\SelectorInterface
Returns
TypeDescription
string
methodprotectedconvertSource(\PHPCR\Query\QOM\SourceInterface $source) : string
abstract

Convert a source.

This is different between SQL1 and SQL2

Parameters
NameTypeDescription
$source\PHPCR\Query\QOM\SourceInterface
Returns
TypeDescription
string
methodprotectedconvertStaticOperand(\PHPCR\Query\QOM\StaticOperandInterface $operand) : string

StaticOperand ::= Literal | BindVariableValue

Literal ::= CastLiteral | UncastLiteral CastLiteral ::= 'CAST(' UncastLiteral ' AS ' PropertyType ')'

PropertyType ::= 'STRING' | 'BINARY' | 'DATE' | 'LONG' | 'DOUBLE' | 'DECIMAL' | 'BOOLEAN' | 'NAME' | 'PATH' | 'REFERENCE' | 'WEAKREFERENCE' | 'URI' UncastLiteral ::= UnquotedLiteral | ''' UnquotedLiteral ''' | '“' UnquotedLiteral '“' UnquotedLiteral ::= // String form of a JCR Value

BindVariableValue ::= '$'bindVariableName bindVariableName ::= Prefix

Parameters
NameTypeDescription
$operand\PHPCR\Query\QOM\StaticOperandInterface
Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.0.0a12.