james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1049103 - /james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRCachingUidProvider.java
Date Tue, 14 Dec 2010 14:24:58 GMT
Author: norman
Date: Tue Dec 14 14:24:58 2010
New Revision: 1049103

URL: http://svn.apache.org/viewvc?rev=1049103&view=rev
Log:
Fix JCRCachingUidProvider query to detect last uid

Modified:
    james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRCachingUidProvider.java

Modified: james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRCachingUidProvider.java
URL: http://svn.apache.org/viewvc/james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRCachingUidProvider.java?rev=1049103&r1=1049102&r2=1049103&view=diff
==============================================================================
--- james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRCachingUidProvider.java
(original)
+++ james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/mail/JCRCachingUidProvider.java
Tue Dec 14 14:24:58 2010
@@ -56,7 +56,7 @@ public class JCRCachingUidProvider exten
         try {
             Session s = repos.login(session);
             // we use order by because without it count will always be 0 in jackrabbit
-            String queryString = "/jcr:root" + ISO9075.encodePath(s.getNodeByIdentifier(mailbox.getMailboxId()).getPath())
+ "//element(*,jamesMailbox:message) order by @" + JCRMessage.UID_PROPERTY + " asc";
+            String queryString = "/jcr:root/" + ISO9075.encodePath(s.getNodeByIdentifier(mailbox.getMailboxId()).getPath())
+ "//element(*,jamesMailbox:message) order by @" + JCRMessage.UID_PROPERTY + " desc";
             QueryManager manager = s.getWorkspace().getQueryManager();
             Query q = manager.createQuery(queryString, Query.XPATH);
             q.setLimit(1);



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message