0

I have query

SELECT * 
FROM [cq:ReplicationStatus] AS node 
WHERE (ISDESCENDANTNODE(node,'/home/users/we-retail') 
  AND node.[rep:authorizableId] = ${userId}) 

and I have a function

public HashMap<String, Object> getInformation(Integer userId) throws IOException, RepositoryException 
{
     ... 
}

where I execute my query. But it does not work, because ${userId} is a string not an expression. I also tried

SELECT * 
FROM [cq:ReplicationStatus] AS node 
WHERE (ISDESCENDANTNODE(node,'/home/users/A') 
  AND node.[rep:authorizableId] = '\"+userId+\"')"

Where is my mistake?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
kmj
  • 15
  • 4

1 Answers1

0

I'm not sure if I understand you right:

public HashMap<String, Object> getInformation(Integer userId) throws 
       IOException, RepositoryException 
{
     String sqlQueryStr = "SELECT * FROM [cq:ReplicationStatus] AS node
     WHERE (ISDESCENDANTNODE(node,'/home/users/A') AND 
     node.[rep:authorizableId] = '"+userId+"')";
     ... 
}

should work.

Reporter
  • 3,897
  • 5
  • 33
  • 47