I'm learning how to use Marklogic 6 via the Java API and I'd now like to find out how to search/list/paginate through documents within Java and JAXB. Specifically:
Suppose I have a set of user documents like so:
/user/joe453.xml
/user/karla47.xml
.
.
.
/user/sam.xml
/user/tom.xml
And a user is somewhat defined like this:
<user userId="aaabbb123" passwordHash="bcryptHash">
<role id="USER"> <--- other role types here depending on the kind of user.
</user>
I know I could do a Key/value based search if I wanted to search for a specific user over the userId attribute. However:
1) What functionality of the Java API should I use to, in the simplest case, list/paginate over all these users?
2) I know I could do an ad hoc XQuery using XCC but I really learned bad lessons the last time I used hardcoded query strings in SQL. I can see a similar fate with XML/Marklogic.
3) Is there a better way to do this?
Thanks!