phpcr/phpcr — Issue #13: Square brackets inconsistency in QOM query
Author: nacmartin
Created: 2011-10-26 10:03:43+00:00
State: open

When building a QOM Query there is an inconsistency:

if I do `$qomfactory->comparison($qomfactory->propertyValue('[phpcr:class]'), Constants::JCR_OPERATOR_EQUAL_TO...` I need here square brackets for the property.

But, when building the selector: `$qomfactory->selector($classMetadata->nodeType)` they are not needed, because the SQLGenerator already it: https://github.com/phpcr/phpcr/blob/master/src/PHPCR/Util/QOM/Sql2Generator.php#L52

In fact, adding them manually causes an `HTTP 400: '[' not allowed in name` error

According to @dbu "using the factory, you should never need to put brackets, as its a sql2 implementation detail that : is not a legal character without brackets".