Created
March 23, 2016 18:49
-
-
Save auniverseaway/a88d2b4df12b35f5a8f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public NodeIterator getChildren() { | |
QueryManager queryManager = session.getWorkspace().getQueryManager(); | |
String query = "SELECT * FROM [nt:unstructured] AS s " | |
+ "WHERE [title] IS NOT NULL " | |
+ "ORDER BY [created] DESC"; | |
Query query = queryManager.createQuery(query, Query.JCR_SQL2); | |
// Set Offset | |
if (offset != null) { | |
query.setOffset(offset); | |
} | |
// Set Limit | |
if (limit != null) { | |
query.setLimit(limit); | |
} | |
QueryResult result = query.execute(); | |
return result.getNodes(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment