[seam-issues] [JBoss JIRA] (SEAMJCR-26) Add lazy query to method annotated by "@JcrQuery"
Waldemar Klaczynski (JIRA)
jira-events at lists.jboss.org
Wed Oct 24 12:30:01 EDT 2012
Waldemar Klaczynski created SEAMJCR-26:
------------------------------------------
Summary: Add lazy query to method annotated by "@JcrQuery"
Key: SEAMJCR-26
URL: https://issues.jboss.org/browse/SEAMJCR-26
Project: Seam JCR
Issue Type: Feature Request
Components: OCM
Affects Versions: 3.1.0.Final, Future
Reporter: Waldemar Klaczynski
There is no lazy querying functions for methods with the annotation "@JcrQuery". This could be easily accomplished by adding two annotations parameters: @ JcrLimit and @ JcrOffset.
QueryManager queryManager = session.getWorkspace().getQueryManager();
Query resultQuery = queryManager.createQuery(query, language);
Annotation[][] annotations = method.getParameterAnnotations();
for (int i = 0; i < params.length; i++) {
Value value = (Value) params[i];
if (annotations[i][0] instanceof JcrOffset) {
resultQuery.setOffset(value.getLong());
} else if (annotations[i][0] instanceof JcrLimit) {
resultQuery.setLimit(value.getLong());
} else {
JcrParam param = (JcrParam) annotations[i][0];
resultQuery.bindValue(param.value(), value);
}
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the seam-issues
mailing list