phpcr-utils/src/PHPCR/Util/QOM/QomToSql1QueryConverter.php
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.
\PHPCR\Util\QOM\QomToSql1QueryConverter
Properties
\PHPCR\Util\QOM\BaseSqlGenerator $generator
Methods
__construct(\PHPCR\Util\QOM\BaseSqlGenerator $generator) : void
Instantiate the converter
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::__construct()Name | Type | Description |
---|---|---|
$generator | \PHPCR\Util\QOM\BaseSqlGenerator |
convert(\PHPCR\Query\QOM\QueryObjectModelInterface $query) : string
Query ::= 'SELECT' columns 'FROM' Source ['WHERE' Constraint] ['ORDER BY' orderings]
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convert()Name | Type | Description |
---|---|---|
$query | \PHPCR\Query\QOM\QueryObjectModelInterface |
Type | Description |
---|---|
string |
convertBindVariable(string $var) : string
BindVariableValue ::= '$'bindVariableName bindVariableName ::= Prefix
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertBindVariable()Name | Type | Description |
---|---|---|
$var | string |
Type | Description |
---|---|
string |
convertColumns(\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
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertColumns()Name | Type | Description |
---|---|---|
$columns | \PHPCR\Query\QOM\ColumnInterface[] |
Type | Description |
---|---|
string |
convertComparison(\PHPCR\Query\QOM\ComparisonInterface $comparison) : string
Comparison ::= DynamicOperand Operator StaticOperand
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertComparison()Operator ::= EqualTo | NotEqualTo | LessThan | LessThanOrEqualTo | GreaterThan | GreaterThanOrEqualTo | Like EqualTo ::= '=' NotEqualTo ::= '<>' LessThan ::= '<' LessThanOrEqualTo ::= '<=' GreaterThan ::= '>' GreaterThanOrEqualTo ::= '>=' Like ::= 'LIKE'
Name | Type | Description |
---|---|---|
$comparison | \PHPCR\Query\QOM\ComparisonInterface |
Type | Description |
---|---|
string |
convertConstraint(\PHPCR\Query\QOM\ConstraintInterface $constraint) : string
Constraint ::= And | Or | Not | Comparison | PropertyExistence | FullTextSearch | SameNode | ChildNode | DescendantNode
And ::= constraint1 'AND' constraint2 Or ::= constraint1 'OR' constraint2 Not ::= 'NOT' Constraint
Name | Type | Description |
---|---|---|
$constraint | \PHPCR\Query\QOM\ConstraintInterface |
Type | Description |
---|---|
string |
convertDynamicOperand(\PHPCR\Query\QOM\DynamicOperandInterface $operand) : string
DynamicOperand ::= PropertyValue | LowerCase | UpperCase
LowerCase ::= 'LOWER(' DynamicOperand ')' UpperCase ::= 'UPPER(' DynamicOperand ')'
Name | Type | Description |
---|---|---|
$operand | \PHPCR\Query\QOM\DynamicOperandInterface |
Type | Description |
---|---|
string |
convertFullTextSearch(\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
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertFullTextSearch()Name | Type | Description |
---|---|---|
$constraint | \PHPCR\Query\QOM\FullTextSearchInterface |
Type | Description |
---|---|
string |
convertFullTextSearchExpression(string $expr) : string
FullTextSearchExpression ::= BindVariable | ''' FullTextSearchLiteral '''
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertFullTextSearchExpression()Name | Type | Description |
---|---|---|
$expr | string |
Type | Description |
---|---|
string |
convertLiteral(mixed $literal) : string
Literal ::= CastLiteral | UncastLiteral
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertLiteral()Name | Type | Description |
---|---|---|
$literal | mixed |
Type | Description |
---|---|
string |
convertOrderings(\PHPCR\Query\QOM\OrderingInterface[] $orderings) : string
orderings ::= Ordering {',' Ordering} Ordering ::= DynamicOperand [Order] Order ::= Ascending | Descending Ascending ::= 'ASC' Descending ::= 'DESC'
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertOrderings()Name | Type | Description |
---|---|---|
$orderings | \PHPCR\Query\QOM\OrderingInterface[] |
Type | Description |
---|---|
string |
convertPath(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
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertPath()Name | Type | Description |
---|---|---|
$path | string |
Type | Description |
---|---|
string |
convertPropertyExistence(\PHPCR\Query\QOM\PropertyExistenceInterface $constraint) : string
PropertyExistence ::= selectorName'.'propertyName 'IS NOT NULL' | propertyName 'IS NOT NULL' If only one selector exists in this query
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertPropertyExistence()Note: The negation, 'NOT x IS NOT NULL' can be written 'x IS NULL'
Name | Type | Description |
---|---|---|
$constraint | \PHPCR\Query\QOM\PropertyExistenceInterface |
Type | Description |
---|---|
string |
convertPropertyValue(\PHPCR\Query\QOM\PropertyValueInterface $value) : string
PropertyValue ::= [selectorName'.'] propertyName // If only one selector exists
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertPropertyValue()Name | Type | Description |
---|---|---|
$value | \PHPCR\Query\QOM\PropertyValueInterface |
Type | Description |
---|---|
string |
convertSelector(\PHPCR\Query\QOM\SelectorInterface $selector) : string
Selector ::= nodeTypeName ['AS' selectorName] nodeTypeName ::= Name
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertSelector()Name | Type | Description |
---|---|---|
$selector | \PHPCR\Query\QOM\SelectorInterface |
Type | Description |
---|---|
string |
convertSource(\PHPCR\Query\QOM\SourceInterface $source) : string
Source ::= Selector
This is different between SQL1 and SQL2
Name | Type | Description |
---|---|---|
$source | \PHPCR\Query\QOM\SourceInterface |
Type | Description |
---|---|
string |
convertStaticOperand(\PHPCR\Query\QOM\StaticOperandInterface $operand) : string
StaticOperand ::= Literal | BindVariableValue
Inherited from: \PHPCR\Util\QOM\BaseQomToSqlQueryConverter::convertStaticOperand()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
Name | Type | Description |
---|---|---|
$operand | \PHPCR\Query\QOM\StaticOperandInterface |
Type | Description |
---|---|
string |