You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by sam ” <sk...@gmail.com> on 2011/07/14 15:04:45 UTC

bidirectional query conversion, or abstract query representation?

Is there abstract representation of a Query so that I can parse xpath, sql,
sql2, jqom statements to the representation, transform the representation a
bit, and spit out any of xpath,sql,sql2,jqom statement?

javax.jcr.Query is bound to one Language representation (either
xpath,sql,sql2,jqom).

Re: bidirectional query conversion, or abstract query representation?

Posted by Alexander Klimetschek <ak...@adobe.com>.
On 14.07.11 15:07, "sam ²" <sk...@gmail.com> wrote:

>http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/query/qom/Qu
>eryObjectModel.html
>How can I generate xpath or sql from QueryObjectModel ?

Generating the JCR-SQL2 from qom is something that you have to write
yourself if I am not mistaken, but it should be possible, since there is
an exact mapping defined between qom and JCR-SQL2 in the spec.

Generating xpath from it is more difficult, and there are some features
that are in one language but not the other (e.g. joins not in xpath).

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel





Re: bidirectional query conversion, or abstract query representation?

Posted by sam ” <sk...@gmail.com>.
http://www.day.com/maven/javax.jcr/javadocs/jcr-2.0/javax/jcr/query/qom/QueryObjectModel.html
How can I generate xpath or sql from QueryObjectModel ?

On Thu, Jul 14, 2011 at 9:04 AM, sam ” <sk...@gmail.com> wrote:

> Is there abstract representation of a Query so that I can parse xpath, sql,
> sql2, jqom statements to the representation, transform the representation a
> bit, and spit out any of xpath,sql,sql2,jqom statement?
>
> javax.jcr.Query is bound to one Language representation (either
> xpath,sql,sql2,jqom).
>
>