java - How to apply aggregate functions(like MIN, MAX, COUNT) in JCR-SQL2? -
java - How to apply aggregate functions(like MIN, MAX, COUNT) in JCR-SQL2? -
i have records stored nodes in jcr , name of node primary key. eg 1,2,3. problem starts here,
the records follows 1,2,6,53,54
where numbers above nodes under emp unstructured node. if do
int count=empnode.getnodeiterator().getsize()
i 5 there 5 nodes
so count++ gives me 6 6 exists, so can't create node name 6 under emp[nt:unstructred], thats why want apply max(nodenames) in query. should ?
update :: utilize cq5.5. emp unstructered node under content /content/emp. under this(emp) have unstructered nodes hold data. , these node have names 1,2, etc
i tried cq5.4 instance find soloution. unfortunatly tries not successful. when used keywords 'sql2 count' google, found this page. there asked same question , reply was
there no count(*) or grouping selector in jcr sql 1, xpath [2] or jcr-sql2/aqm [3].
to implement such tag cloud, can run 1 query fetches content containing relevant "tag" property:
//element(*, my:article)[@tag]
and iterate on result , count tags on application side looking @ tag property values , using hashmap (tagid -> count).
http://www.day.com/specs/jcr/1.0/ (section 8.5)
http://www.day.com/specs/jcr/1.0/ (section 6.6)
http://www.day.com/specs/jcr/2.0/6_query.html
i think can connect reply max() , min().
java cq5 jcr jcr-sql2
Comments
Post a Comment