Skip to content

date literal in query invalid #153

Closed
@rmsint

Description

@rmsint

Creating this query using the QueryBuilder:

$qb = $this->dm->createQueryBuilder();
$qb->from()
    ->document('Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock', 'b')
  ->end()
  ->where()
    ->lt()->field('b.createdAt')->literal(new \DateTime())
  ->end()
;

generates this sql-2 query:

SELECT * FROM [nt:unstructured] AS b 
WHERE (b.[jcr:created] < CAST('2013-11-11T14:50:35.000+01:00' AS DATE)
AND (b.[phpcr:class] = 'Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock' OR b.[phpcr:classparents] = 'Symfony\Cmf\Bundle\BlockBundle\Doctrine\Phpcr\SimpleBlock'))

Running the query using app/console doctrine:phpcr:workspace:query tells the query is in invalid (PHPCR\Query\InvalidQueryException), and in code returns no results.

Running the same query when using jackalope-jackrabbit is succeeding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions