phpcr-utils/src/PHPCR/Util/QOM/Sql1Generator.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\Sql1Generator

Package: Default
Generate SQL1 statements

TODO: is eval... the best name for the functions here?

Parent(s)
\PHPCR\Util\QOM\BaseSqlGenerator

Methods

methodpublicevalAnd(string $constraint1, string $constraint2) : void
inherited

And ::= constraint1 'AND' constraint2

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalAnd()
Parameters
NameTypeDescription
$constraint1string
$constraint2string
methodpublicevalBindVariable( $var) : string
inherited

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

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalBindVariable()
Parameters
NameTypeDescription
$var
Returns
TypeDescription
string
methodpublicevalCastLiteral(string $literal, string $type) : string

Cast a literal.

No explicit support, do some tricks where possible.

Parameters
NameTypeDescription
$literalstring
$typestring
Returns
TypeDescription
string
methodpublicevalChildNode(string $path, string $selectorName = null) : void

SameNode ::= 'jcr:path like Path/% and not jcr:path like Path/%/%'

Parameters
NameTypeDescription
$pathstring
$selectorNamestring
methodpublicevalColumn(string $selectorName = null, string $propertyName = null) : string

Column ::= (propertyName) propertyName ::= Name

No support for column name ('AS' columnName) in SQL1

Parameters
NameTypeDescription
$selectorNamestring

unused in SQL1

$propertyNamestring
Returns
TypeDescription
string
methodpublicevalColumns( $columns) : string

columns ::= (Column ',' {Column}) | '*'

Parameters
NameTypeDescription
$columns
Returns
TypeDescription
string
methodpublicevalComparison(string $operand1, string $operator, string $operand2) : void
inherited

Comparison ::= DynamicOperand Operator StaticOperand

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalComparison()
Parameters
NameTypeDescription
$operand1string
$operatorstring
$operand2string
methodpublicevalDescendantNode(string $path) : string

Emulate descendant query with LIKE query

Parameters
NameTypeDescription
$pathstring
Returns
TypeDescription
string
methodpublicevalFullTextSearch(string $selectorName, string $searchExpression, string $propertyName = null) : string

FullTextSearch ::= 'CONTAINS(' (propertyName | '*') ') ',' FullTextSearchExpression ')' FullTextSearchExpression ::= BindVariable | ''' FullTextSearchLiteral '''

Parameters
NameTypeDescription
$selectorNamestring

unusued

$searchExpressionstring
$propertyNamestring
Returns
TypeDescription
string
methodpublicevalLiteral(mixed $literal) : string
inherited

Literal ::= CastLiteral | UncastLiteral

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalLiteral()
Parameters
NameTypeDescription
$literalmixed
Returns
TypeDescription
string
methodpublicevalLower(string $operand) : void
inherited

LowerCase ::= 'LOWER(' DynamicOperand ')'

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalLower()
Parameters
NameTypeDescription
$operandstring
methodpublicevalNot(string $constraint) : void
inherited

Not ::= 'NOT' Constraint

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalNot()
Parameters
NameTypeDescription
$constraintstring
methodpublicevalOperator(string $operator) : void
inherited

Operator ::= EqualTo | NotEqualTo | LessThan | LessThanOrEqualTo | GreaterThan | GreaterThanOrEqualTo | Like

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalOperator()
Parameters
NameTypeDescription
$operatorstring
methodpublicevalOr(string $constraint1, string $constraint2) : void
inherited

Or ::= constraint1 'OR' constraint2

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalOr()
Parameters
NameTypeDescription
$constraint1string
$constraint2string
methodpublicevalOrder( $order) : string
inherited

Order ::= Ascending | Descending Ascending ::= 'ASC' Descending ::= 'DESC'

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalOrder()
Parameters
NameTypeDescription
$order
Returns
TypeDescription
string
methodpublicevalOrdering( $operand,  $order) : string
inherited

Ordering ::= DynamicOperand [Order]

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalOrdering()
Parameters
NameTypeDescription
$operand
$order
Returns
TypeDescription
string
methodpublicevalOrderings( $orderings) : string
inherited

orderings ::= Ordering {',' Ordering}

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalOrderings()
Parameters
NameTypeDescription
$orderings
Returns
TypeDescription
string
methodpublicevalPath(string $path) : string

Path ::= simplePath simplePath ::= A JCR Name that contains only SQL-legal characters

This is different between SQL1 and SQL2.

Parameters
NameTypeDescription
$pathstring
Returns
TypeDescription
string
methodpublicevalPropertyExistence(string $selectorName, string $propertyName) : string

PropertyExistence ::= propertyName 'IS NOT NULL'

Parameters
NameTypeDescription
$selectorNamestring

declared to simplifiy interface - as there are no joins in SQL1 there is no need for a selector.

$propertyNamestring
Returns
TypeDescription
string
methodpublicevalPropertyValue(string $propertyName, string $selectorName = null) : void

PropertyValue ::= propertyName

Parameters
NameTypeDescription
$propertyNamestring
$selectorNamestring

unused in SQL1

methodpublicevalQuery(string $source, string $columns, string $constraint = '', string $orderings = '') : string
inherited

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

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalQuery()
Parameters
NameTypeDescription
$sourcestring
$columnsstring
$constraintstring
$orderingsstring
Returns
TypeDescription
string
methodpublicevalSelector(string $nodeTypeName, string $selectorName = null) : string

Selector ::= nodeTypeName nodeTypeName ::= Name

Parameters
NameTypeDescription
$nodeTypeNamestring

The node type of the selector. If it does not contain starting and ending brackets ([]) they will be added automatically

$selectorNamestring

(unused)

Returns
TypeDescription
string
methodpublicevalUpper(string $operand) : void
inherited

LowerCase ::= 'UPPER(' DynamicOperand ')'

Inherited from: \PHPCR\Util\QOM\BaseSqlGenerator::evalUpper()
Parameters
NameTypeDescription
$operandstring
methodprotectedgetPathForDescendantQuery( $path) : string

Helper method to emulate descendant with LIKE query on path property.

Parameters
NameTypeDescription
$path
Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.0.0a12.