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

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Jan 4 06:33:34 EST 2010


Author: sergiykarpenko
Date: 2010-01-04 06:33:34 -0500 (Mon, 04 Jan 2010)
New Revision: 1269

Modified:
   jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
   jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
Log:
EXOJCR-302: FIND_NODES_BY_PARENTID_CQ ordering updated

Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java	2010-01-04 11:27:34 UTC (rev 1268)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java	2010-01-04 11:33:34 UTC (rev 1269)
@@ -198,9 +198,9 @@
 
       FIND_NODES_BY_PARENTID_CQ =
          "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
-            + " from (select * from JCR_MITEM where PARENT_ID=? AND I_CLASS=1) I, JCR_MITEM P, JCR_MVALUE V"
+            + " from (select * from JCR_MITEM where PARENT_ID=? and I_CLASS=1) I, JCR_MITEM P, JCR_MVALUE V"
             + " where (P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
-            + " order by I.ID, PROP_NAME DESC, V.ORDER_NUM"; //I.N_ORDER_NUM
+            + " order by I.N_ORDER_NUM, I.ID, PROP_NAME DESC, V.ORDER_NUM"; //I.N_ORDER_NUM
 
       FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
          "select I.NAME, V.DATA"

Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java	2010-01-04 11:27:34 UTC (rev 1268)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java	2010-01-04 11:33:34 UTC (rev 1269)
@@ -84,7 +84,7 @@
    protected PreparedStatement findPropertiesByParentIdCQ;
 
    protected PreparedStatement findNodeMainPropertiesByParentIdentifierCQ;
-   
+
    protected PreparedStatement insertItem;
 
    protected PreparedStatement insertNode;
@@ -203,15 +203,15 @@
 
       FIND_NODES_BY_PARENTID_CQ =
          "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
-         + " from (select * from JCR_SITEM where CONTAINER_NAME=? and PARENT_ID=? AND I_CLASS=1) I, JCR_SITEM P, JCR_SVALUE V"
-         + " where (P.CONTAINER_NAME=? and P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
-         + " order by I.N_ORDER_NUM, PROP_NAME DESC, V.ORDER_NUM";
+            + " from (select * from JCR_SITEM where CONTAINER_NAME=? and PARENT_ID=? AND I_CLASS=1) I, JCR_SITEM P, JCR_SVALUE V"
+            + " where (P.CONTAINER_NAME=? and P.PARENT_ID=I.ID and P.I_CLASS=2 and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and V.PROPERTY_ID=P.ID)"
+            + " order by I.N_ORDER_NUM, I.ID, PROP_NAME DESC, V.ORDER_NUM";
 
-      FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ = 
+      FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ =
          "select I.NAME, V.DATA"
-         + " from JCR_SITEM I, JCR_SVALUE V"
-         + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
-      
+            + " from JCR_SITEM I, JCR_SVALUE V"
+            + " where I.I_CLASS=2 and I.CONTAINER_NAME=? and I.PARENT_ID=? and (I.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or I.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or I.NAME='[http://www.exoplatform.com/jcr/exo/1.0]permissions') and I.ID=V.PROPERTY_ID order by V.ORDER_NUM";
+
       FIND_NODES_COUNT_BY_PARENTID =
          "select count(ID) from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?";
 
@@ -638,12 +638,13 @@
    protected ResultSet findNodeMainPropertiesByParentIdentifierCQ(String parentIdentifier) throws SQLException
    {
       if (findNodeMainPropertiesByParentIdentifierCQ == null)
-         findNodeMainPropertiesByParentIdentifierCQ = dbConnection.prepareStatement(FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ);
+         findNodeMainPropertiesByParentIdentifierCQ =
+            dbConnection.prepareStatement(FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ);
       else
          findNodeMainPropertiesByParentIdentifierCQ.clearParameters();
 
       findNodeMainPropertiesByParentIdentifierCQ.setString(1, containerName);
       findNodeMainPropertiesByParentIdentifierCQ.setString(2, parentIdentifier);
       return findNodeMainPropertiesByParentIdentifierCQ.executeQuery();
-   }   
+   }
 }



More information about the exo-jcr-commits mailing list