Skip to content

Instantly share code, notes, and snippets.

@lsmith77
Created July 5, 2013 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsmith77/5934872 to your computer and use it in GitHub Desktop.
Save lsmith77/5934872 to your computer and use it in GitHub Desktop.
empty result
SELECT
n0.id AS id,
n0.path AS path,
n0.parent AS parent,
n0.local_name AS local_name,
n0.namespace AS namespace,
n0.workspace_name AS workspace_name,
n0.identifier AS identifier,
n0.type AS type,
n0.props AS props,
n0.depth AS depth,
n0.sort_order AS sort_order
FROM
phpcr_nodes n0
WHERE
n0.workspace_name = ?
AND n0.type IN ('nt:unstructured', 'rep:root')
AND (
(
EXTRACTVALUE(
n0.props, 'count(//sv:property[@sv:name="phpcr:class"]/sv:value[text()="Symfony\\Cmf\\Bundle\\ContentBundle\\Document\\MultilangStaticContent"]) > 0'
)
OR EXTRACTVALUE(
n0.props, 'count(//sv:property[@sv:name="phpcr:classparents"]/sv:value[text()="Symfony\\Cmf\\Bundle\\ContentBundle\\Document\\MultilangStaticContent"]) > 0'
)
)
AND (
EXTRACTVALUE(
n0.props, 'count(//sv:property[@sv:name="phpcr:class"]/sv:value[text()="Symfony\\Cmf\\Bundle\\ContentBundle\\Document\\MultilangStaticContent"]) > 0'
)
OR EXTRACTVALUE(
n0.props, 'count(//sv:property[@sv:name="phpcr:classparents"]/sv:value[text()="Symfony\\Cmf\\Bundle\\ContentBundle\\Document\\MultilangStaticContent"]) > 0'
)
)
)
ORDER BY
EXTRACTVALUE(
n0.props, '//sv:property[@sv:name="path"]/sv:value[1]'
) ASC
expected result
SELECT
n0.id AS id,
n0.path AS path,
n0.parent AS parent,
n0.local_name AS local_name,
n0.namespace AS namespace,
n0.workspace_name AS workspace_name,
n0.identifier AS identifier,
n0.type AS type,
n0.props AS props,
n0.depth AS depth,
n0.sort_order AS sort_order
FROM
phpcr_nodes n0
WHERE
n0.workspace_name = ?
AND n0.type IN ('nt:unstructured', 'rep:root')
AND (
EXTRACTVALUE(
n0.props, '//sv:property[@sv:name="phpcr:class"]/sv:value[1]'
) = 'Symfony\Cmf\Bundle\ContentBundle\Document\MultilangStaticContent'
OR EXTRACTVALUE(
n0.props, '//sv:property[@sv:name="phpcr:classparents"]/sv:value[1]'
) = 'Symfony\Cmf\Bundle\ContentBundle\Document\MultilangStaticContent'
)
ORDER BY
EXTRACTVALUE(
n0.props, '//sv:property[@sv:name="path"]/sv:value[1]'
) ASC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment