Author: tolusha
Date: 2011-07-28 03:36:19 -0400 (Thu, 28 Jul 2011)
New Revision: 4685
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
Log:
EXOJCR-1453: Adoption and testing on all supported DB
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-07-28
06:01:42 UTC (rev 4684)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-07-28
07:36:19 UTC (rev 4685)
@@ -207,11 +207,13 @@
UPDATE_VALUE = "update JCR_MVALUE set DATA=?, STORAGE_DESC=? where
PROPERTY_ID=? and ORDER_NUM=?";
FIND_NODES_BY_PARENTID_LAZILY_CQ =
- "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from JCR_MITEM I, JCR_MITEM P, JCR_MVALUE V"
+ "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_MITEM I,
JCR_MITEM P, JCR_MVALUE V"
+ " where I.I_CLASS=1 and I.PARENT_ID=? and I.N_ORDER_NUM >= ?
and"
- + " P.I_CLASS=2 and P.PARENT_ID=I.ID 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 LIMIT ?";
+ + " P.I_CLASS=2 and P.PARENT_ID=I.ID 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";
}
/**
@@ -578,7 +580,7 @@
findNodesByParentIdLazilyCQ.setString(1, parentCid);
findNodesByParentIdLazilyCQ.setInt(2, fromOrderNum);
- findNodesByParentIdLazilyCQ.setInt(3, limit);
+ findNodesByParentIdLazilyCQ.setMaxRows(limit);
return findNodesByParentIdLazilyCQ.executeQuery();
}
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-07-28
06:01:42 UTC (rev 4684)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-07-28
07:36:19 UTC (rev 4685)
@@ -212,11 +212,14 @@
UPDATE_VALUE = "update JCR_SVALUE set DATA=?, STORAGE_DESC=? where
PROPERTY_ID=? and ORDER_NUM=?";
FIND_NODES_BY_PARENTID_LAZILY_CQ =
- "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA"
- + " from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V"
+ "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_SITEM I,
JCR_SITEM P, JCR_SVALUE V"
+ " where I.I_CLASS=1 and I.CONTAINER_NAME=? and I.PARENT_ID=? and
I.N_ORDER_NUM >= ? and "
- + " P.I_CLASS=2 and P.CONTAINER_NAME=? and P.PARENT_ID=I.ID 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 LIMIT ?";
+ + " P.I_CLASS=2 and P.CONTAINER_NAME=? and P.PARENT_ID=I.ID 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";
}
/**
@@ -501,7 +504,7 @@
findNodesByParentIdLazilyCQ.setString(2, parentCid);
findNodesByParentIdLazilyCQ.setInt(3, fromOrderNum);
findNodesByParentIdLazilyCQ.setString(4, containerName);
- findNodesByParentIdLazilyCQ.setInt(5, limit);
+ findNodesByParentIdLazilyCQ.setMaxRows(limit);
return findNodesByParentIdLazilyCQ.executeQuery();
}