Which one is best to query the jcr ? Is SQL or JCRSQL2 or JQOM ? | Community
Skip to main content
October 16, 2015
Solved

Which one is best to query the jcr ? Is SQL or JCRSQL2 or JQOM ?

  • October 16, 2015
  • 3 replies
  • 1971 views

Hi,

 

SQL - select * from nt:base where cq:lastModified > TIMESTAMP  '2014-04-08T23:59:59.000+05:30'
 is works fine .But for JCR-SQL2 what will be the query I tried this

SELECT * FROM [nt:base] AS s WHERE cq:lastModified > TIMESTAMP  '2014-04-08T23:59:59.000+05:30'

But no luck.

Thanks in advance

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ove_Lindström

SQL is the one that most developers knows and is most likely to get correct. But, some things are not doable.

JCR-SQL2 has a lot of power an the ability to do whatever you want in the JCR tree.

JQOM is just a Java representation of the JCR-SQL2 and eventually boils down to a SQL2 query. I actually like this one, since I don't have mess around with a lot or String concatenation.

Just my $0.02.

 

/Ove

3 replies

October 16, 2015

You can try this one for SQL2. Worked for me:

SELECT s.*
FROM [nt:base] AS s
WHERE s.[cq:lastModified] >= CAST('2014-04-08T23:59:59.000+05:30' AS DATE)

Many Thanks and Best Regards,

Neha Sinha

October 16, 2015

Yes i tried that it worked.

But which query language is recommended to do ?

Thanks

Ove_LindströmAccepted solution
Level 6
October 16, 2015

SQL is the one that most developers knows and is most likely to get correct. But, some things are not doable.

JCR-SQL2 has a lot of power an the ability to do whatever you want in the JCR tree.

JQOM is just a Java representation of the JCR-SQL2 and eventually boils down to a SQL2 query. I actually like this one, since I don't have mess around with a lot or String concatenation.

Just my $0.02.

 

/Ove