[exo-jcr-commits] exo-jcr SVN: r1289 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Jan 5 06:37:19 EST 2010


Author: sergiykarpenko
Date: 2010-01-05 06:37:19 -0500 (Tue, 05 Jan 2010)
New Revision: 1289

Modified:
   jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
Log:
EXOJCR-302: code cleanup

Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java	2010-01-05 11:31:28 UTC (rev 1288)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java	2010-01-05 11:37:19 UTC (rev 1289)
@@ -266,12 +266,8 @@
          {
             String cid = resultSet.getString(COLUMN_ID);
             String identifier = getIdentifier(cid);
-            String cname = resultSet.getString(COLUMN_NAME);
+
             int cversion = resultSet.getInt(COLUMN_VERSION);
-            String cpid = resultSet.getString(COLUMN_PARENTID);
-            int cptype = resultSet.getInt(COLUMN_PTYPE);
-            boolean cpmultivalued = resultSet.getBoolean(COLUMN_PMULTIVALUED);
-            QPath qpath = QPath.makeChildPath(traverseQPath(cpid), InternalQName.parse(cname));
 
             int valueOrderNum = resultSet.getInt(COLUMN_VORDERNUM);
             PersistedPropertyData prop = propertyBuffer.get(identifier);
@@ -279,6 +275,13 @@
             if (prop == null)
             {
                // make temporary PropertyData without values
+               String cname = resultSet.getString(COLUMN_NAME);
+
+               String cpid = resultSet.getString(COLUMN_PARENTID);
+               int cptype = resultSet.getInt(COLUMN_PTYPE);
+               boolean cpmultivalued = resultSet.getBoolean(COLUMN_PMULTIVALUED);
+               QPath qpath = QPath.makeChildPath(traverseQPath(cpid), InternalQName.parse(cname));
+
                prop =
                   new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued,
                      null);
@@ -601,19 +604,16 @@
          List<ValueData> data = new ArrayList<ValueData>();
          String identifier = getIdentifier(cid);
 
-         int orderNum = -1;
-
          do
          {
-            orderNum = resultSet.getInt(COLUMN_VORDERNUM);
+            int orderNum = resultSet.getInt(COLUMN_VORDERNUM);
             final String storageId = resultSet.getString(COLUMN_VSTORAGE_DESC);
             ValueData vdata =
                resultSet.wasNull() ? readValueData(cid, orderNum, cversion, resultSet.getBinaryStream(COLUMN_VDATA))
                   : readValueData(identifier, orderNum, storageId);
             data.add(vdata);
          }
-         while (resultSet.next() && resultSet.getString(COLUMN_ID).equals(cid)
-            && (resultSet.getInt(COLUMN_VORDERNUM)) > orderNum);
+         while (resultSet.next() && resultSet.getString(COLUMN_ID).equals(cid));
 
          PersistedPropertyData pdata =
             new PersistedPropertyData(identifier, qpath, getIdentifier(cpid), cversion, cptype, cpmultivalued, data);



More information about the exo-jcr-commits mailing list