Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

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

Avatar

Former Community Member

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

1 Accepted Solution

Avatar

Correct answer by
Level 6

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

View solution in original post

3 Replies

Avatar

Level 1

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

Avatar

Former Community Member

Yes i tried that it worked.

But which query language is recommended to do ?

Thanks

Avatar

Correct answer by
Level 6

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