I am trying to get the number (count) of associations for an asset/folder by using the reference type in Java.
But, I don't have an idea how to achieve this.
I have written a query to get this, but this is from alfresco tables. Also, this query fetches the associations only for Asset types not for folders.
Here is the query what I have written
SELECT COUNT(*) FROM alf_node aNode
INNER JOIN alf_node_assoc ana ON aNode.id = ana.source_node_id
INNER JOIN alf_qname aqn ON ana.type_qname_id = aqn.id
WHERE aNode.uuid = "897f6e7a-a9bf-46ea-95b8-b9hyyji7hhuu8"
AND aqn.local_name = "imageReference";
I need this result but, from java code and also, the above query works for asset but not for folders.
I don't need the records, I just need the count of associations
Any help will be really appriciated.
Thanks in advance