I have some records stored as Nodes in JCR and the name of the node is the primary key. eg 1,2,3. But the problem starts here,
the records are as follows 1,2,6,53,54
Where the numbers above are nodes under EMP unstructured node. If I do
int count=empNode.getNodeIterator().getSize()
I will get 5 As there are 5 nodes
So I do count++ which gives me 6 but 6 already exists, so I can't create a node with name 6 under EMP[nt:unstructred], thats why I want to apply MAX(nodeNames) something in the query. What should I do ?
Update :: I use CQ5.5. EMP is an unstructered node under content like /content/EMP. Under this(EMP) I have unstructered nodes that hold my data. And these node have names as 1,2, etc