portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r1738664 - /portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
Date Mon, 11 Apr 2016 23:19:49 GMT
Author: taylor
Date: Mon Apr 11 23:19:49 2016
New Revision: 1738664

URL: http://svn.apache.org/viewvc?rev=1738664&view=rev
Log:
JS2-1353: improving preferences search queries to do only 2 queries, not 1 + n where n is
the number of pref values found

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java?rev=1738664&r1=1738663&r2=1738664&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
Mon Apr 11 23:19:49 2016
@@ -945,10 +945,8 @@ public class PortletPreferencesServiceIm
         c.addEqualTo(USER_NAME, userName);
         //query.addOrderByAscending(DTYPE);
         QueryByCriteria query = QueryFactory.newQuery(DatabasePreference.class, c);
-        Iterator<DatabasePreference> preferences = getPersistenceBrokerTemplate().getIteratorByQuery(query);
-        while (preferences.hasNext())
-        {
-            DatabasePreference preference = preferences.next();
+        Collection<DatabasePreference> preferences1 = getPersistenceBrokerTemplate().getCollectionByQuery(query);
+        for (DatabasePreference preference : preferences1) {
             Map<String,PortletPreference> windowPreferences = sessionPreferences.getWindowPreferences(preference.getEntityId());
             if (windowPreferences == null) {
                 windowPreferences = sessionPreferences.createWindowPreferences(preference.getEntityId());



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


Mime
View raw message