Query to return all component group using JCR-SQL2 | Community
Skip to main content
New Participant
May 16, 2023
Solved

Query to return all component group using JCR-SQL2

  • May 16, 2023
  • 1 reply
  • 647 views

I would like to write a query using JCR-SQL2 to return all component groups. 

 

I tried the following but it is not returning anything:

SELECT * FROM [componentGroup] 

 

Does anyone have any suggestions? Thanks!

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 ShubhanshuSi2

@aemuser2345 ,

You have to modify your query a bit, 'componentGroup' is not a valid node type

Use the below query to get the valid nodes 

SELECT 'componentGroup' FROM [cq:Component]

 

add a WHERE ISDESCENDANTNODE clause if you want to get component groups under a specific path

In your code then, you can get the value of 'componentGroup' property if required


1 reply

ShubhanshuSi2Accepted solution
New Participant
May 16, 2023

@aemuser2345 ,

You have to modify your query a bit, 'componentGroup' is not a valid node type

Use the below query to get the valid nodes 

SELECT 'componentGroup' FROM [cq:Component]

 

add a WHERE ISDESCENDANTNODE clause if you want to get component groups under a specific path

In your code then, you can get the value of 'componentGroup' property if required