You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "johann sorel (JIRA)" <ji...@apache.org> on 2009/10/02 12:39:23 UTC

[jira] Created: (JCR-2343) Utility class to tranform JCR-SQL2 to/from JCR-JQOM

Utility class to tranform JCR-SQL2 to/from JCR-JQOM
---------------------------------------------------

                 Key: JCR-2343
                 URL: https://issues.apache.org/jira/browse/JCR-2343
             Project: Jackrabbit Content Repository
          Issue Type: New Feature
          Components: jackrabbit-jcr-commons
    Affects Versions: 2.0-alpha12
            Reporter: johann sorel
            Priority: Minor


The JCR2 doc specify that both contain the same thing and can be translated from one to another
in a straightforward manner. The jackrabbit-jcr-commons module should offer a utility class to transform
from one language to another in a generic way, 

for exemple :
- String toSQL2(QueryObjectModel qom)
- QueryObjectModel toJQOM(QueryObjectModelFactory factory, String query)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2343) Utility class to tranform JCR-SQL2 to/from JCR-JQOM

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763881#action_12763881 ] 

Marcel Reutegger commented on JCR-2343:
---------------------------------------

Please note that jackrabbit already provides such a functionality.

- To convert from JQOM to SQL2 simply call:
    qom.getStatement()

- To convert from SQL2 to JQOM call:
    QueryManager qm = ...
    QueryObjectModel qom = (QueryObjectModel) qm.createQuery(sql2, Query.JCR_SQL2);

I'm not sure if anything else beyond that is really needed.

> Utility class to tranform JCR-SQL2 to/from JCR-JQOM
> ---------------------------------------------------
>
>                 Key: JCR-2343
>                 URL: https://issues.apache.org/jira/browse/JCR-2343
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.0-alpha12
>            Reporter: johann sorel
>            Priority: Minor
>
> The JCR2 doc specify that both contain the same thing and can be translated from one to another
> in a straightforward manner. The jackrabbit-jcr-commons module should offer a utility class to transform
> from one language to another in a generic way, 
> for exemple :
> - String toSQL2(QueryObjectModel qom)
> - QueryObjectModel toJQOM(QueryObjectModelFactory factory, String query)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2343) Utility class to tranform JCR-SQL2 to/from JCR-JQOM

Posted by "johann sorel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763905#action_12763905 ] 

johann sorel commented on JCR-2343:
-----------------------------------

That's a solution, I agree, but not an available one for us.

I guess this case is special for our applications. 
Our analyze of jackrabbit has show us the fact that jackrabbit-SPI is to far from JCR.
Since we are making a JCR implementation for our data model (Geographic Information Systems) we choose to limit our use of jackrabbit to the JCR-commun module.
There are four main reasons why we don't wont to depend on jackrabbit spi.
- First it's to far from the JCR specification, it's like a second jcr definition.
- We have to learn jackrabbit spi, which is a useless extra step because we want jcr, not spi.
- We lose the control over the code, we have no control over cache, real JCR object, nodes, node types and so on. Spi makes an automatic mapping to jcr interfaces that we don't control.
- And it adds more dependency where we already have more than 40Mb of jars

My question now : 
Is the code handling JQOM/SQL2 really binded to SPI or is it generic/abstract enough to be moved in jackrabbit-jcr-common ?

> Utility class to tranform JCR-SQL2 to/from JCR-JQOM
> ---------------------------------------------------
>
>                 Key: JCR-2343
>                 URL: https://issues.apache.org/jira/browse/JCR-2343
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.0-alpha12
>            Reporter: johann sorel
>            Priority: Minor
>
> The JCR2 doc specify that both contain the same thing and can be translated from one to another
> in a straightforward manner. The jackrabbit-jcr-commons module should offer a utility class to transform
> from one language to another in a generic way, 
> for exemple :
> - String toSQL2(QueryObjectModel qom)
> - QueryObjectModel toJQOM(QueryObjectModelFactory factory, String query)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2343) Utility class to tranform JCR-SQL2 to/from JCR-JQOM

Posted by "johann sorel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763885#action_12763885 ] 

johann sorel commented on JCR-2343:
-----------------------------------

the two methods :
qom.getStatement();
qm.createQuery(sql2, Query.JCR_SQL2); 

Are part of JCR interfaces, They don't do any work unless you implement them.
What I was trying to say is that a basic implementation should be provided in the jackrabbit-jcr-commons module.
That's why I suggest a QueryUtilities class could be made for this purpose since it's straightforward code.

> Utility class to tranform JCR-SQL2 to/from JCR-JQOM
> ---------------------------------------------------
>
>                 Key: JCR-2343
>                 URL: https://issues.apache.org/jira/browse/JCR-2343
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.0-alpha12
>            Reporter: johann sorel
>            Priority: Minor
>
> The JCR2 doc specify that both contain the same thing and can be translated from one to another
> in a straightforward manner. The jackrabbit-jcr-commons module should offer a utility class to transform
> from one language to another in a generic way, 
> for exemple :
> - String toSQL2(QueryObjectModel qom)
> - QueryObjectModel toJQOM(QueryObjectModelFactory factory, String query)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2343) Utility class to tranform JCR-SQL2 to/from JCR-JQOM

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763894#action_12763894 ] 

Marcel Reutegger commented on JCR-2343:
---------------------------------------

I see. In that case you can use QueryObjectModelBuilder in jackrabbit-spi-commons.

- from JQOM to SQL2:
    QueryObjectModelBuilderRegistry.getQueryObjectModelBuilder(Query.JCR_SQL2).toString(qom);

- from SQL2 to JQOM:
    QueryObjectModelFactory qf = ...
    ValueFactory vf = ...
    QueryObjectModelBuilder qomBuilder = QueryObjectModelBuilderRegistry.getQueryObjectModelBuilder(Query.JCR_SQL2);
    qomBuilder.createQueryObjectModel(sql2, qf, vf);

> Utility class to tranform JCR-SQL2 to/from JCR-JQOM
> ---------------------------------------------------
>
>                 Key: JCR-2343
>                 URL: https://issues.apache.org/jira/browse/JCR-2343
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.0-alpha12
>            Reporter: johann sorel
>            Priority: Minor
>
> The JCR2 doc specify that both contain the same thing and can be translated from one to another
> in a straightforward manner. The jackrabbit-jcr-commons module should offer a utility class to transform
> from one language to another in a generic way, 
> for exemple :
> - String toSQL2(QueryObjectModel qom)
> - QueryObjectModel toJQOM(QueryObjectModelFactory factory, String query)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (JCR-2343) Utility class to tranform JCR-SQL2 to/from JCR-JQOM

Posted by sorel <jo...@geomatys.fr>.
Hello,

So, what has been decided about this matter ?
For what I can see, if the sql2 <-> qom parser is not related to SPI, 
it's  place in more likely to be in the jcr-commons module. But that's 
only what I can see, i'm not part of jackrabbit :) .

Marcel Reutegger (JIRA) a écrit :
>     [ https://issues.apache.org/jira/browse/JCR-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763931#action_12763931 ] 
>
> Marcel Reutegger commented on JCR-2343:
> ---------------------------------------
>
> AFAICS it does not depend on SPI packages and could be moved to jcr-commons, but this would also affect public classes that we already released and it would potentially break existing code when users upgrade to 2.0.
>
> This mainly affects the SQL2 Parser class, other classes were introduced after the 1.6 release and are not a problem. What do others think? Should we move it to jcr-commons?
>
>   
>> Utility class to tranform JCR-SQL2 to/from JCR-JQOM
>> ---------------------------------------------------
>>
>>                 Key: JCR-2343
>>                 URL: https://issues.apache.org/jira/browse/JCR-2343
>>             Project: Jackrabbit Content Repository
>>          Issue Type: New Feature
>>          Components: jackrabbit-jcr-commons
>>    Affects Versions: 2.0-alpha12
>>            Reporter: johann sorel
>>            Priority: Minor
>>
>> The JCR2 doc specify that both contain the same thing and can be translated from one to another
>> in a straightforward manner. The jackrabbit-jcr-commons module should offer a utility class to transform
>> from one language to another in a generic way, 
>> for exemple :
>> - String toSQL2(QueryObjectModel qom)
>> - QueryObjectModel toJQOM(QueryObjectModelFactory factory, String query)
>>     
>
>   


[jira] Commented: (JCR-2343) Utility class to tranform JCR-SQL2 to/from JCR-JQOM

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763931#action_12763931 ] 

Marcel Reutegger commented on JCR-2343:
---------------------------------------

AFAICS it does not depend on SPI packages and could be moved to jcr-commons, but this would also affect public classes that we already released and it would potentially break existing code when users upgrade to 2.0.

This mainly affects the SQL2 Parser class, other classes were introduced after the 1.6 release and are not a problem. What do others think? Should we move it to jcr-commons?

> Utility class to tranform JCR-SQL2 to/from JCR-JQOM
> ---------------------------------------------------
>
>                 Key: JCR-2343
>                 URL: https://issues.apache.org/jira/browse/JCR-2343
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.0-alpha12
>            Reporter: johann sorel
>            Priority: Minor
>
> The JCR2 doc specify that both contain the same thing and can be translated from one to another
> in a straightforward manner. The jackrabbit-jcr-commons module should offer a utility class to transform
> from one language to another in a generic way, 
> for exemple :
> - String toSQL2(QueryObjectModel qom)
> - QueryObjectModel toJQOM(QueryObjectModelFactory factory, String query)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-2343) Utility class to tranform JCR-SQL2 to/from JCR-JQOM

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger resolved JCR-2343.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

Moved classes JoinType, Operator and Order in package qom (spi-commons) to jcr-commons. Same for QueryObjectModelBuilder and QueryObjectModelBuilderFactory.

Parser (sql2) in spi-commons is now deprecated and extends from the class with the same name in jcr-commons that should now be used.

I had to leave the test cases for the SQL2 parser in spi-commons because of the dependencies it has.

svn revision: 825633

> Utility class to tranform JCR-SQL2 to/from JCR-JQOM
> ---------------------------------------------------
>
>                 Key: JCR-2343
>                 URL: https://issues.apache.org/jira/browse/JCR-2343
>             Project: Jackrabbit Content Repository
>          Issue Type: New Feature
>          Components: jackrabbit-jcr-commons
>    Affects Versions: 2.0-alpha12
>            Reporter: johann sorel
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> The JCR2 doc specify that both contain the same thing and can be translated from one to another
> in a straightforward manner. The jackrabbit-jcr-commons module should offer a utility class to transform
> from one language to another in a generic way, 
> for exemple :
> - String toSQL2(QueryObjectModel qom)
> - QueryObjectModel toJQOM(QueryObjectModelFactory factory, String query)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.