mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
iBatis boolean parameterization in AVM select queries (follow-on for r16347)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16353 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -137,6 +137,10 @@
|
|||||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||||
</parameterMap>
|
</parameterMap>
|
||||||
|
|
||||||
|
<parameterMap id="parameter_BoolMap" class="map">
|
||||||
|
<parameter property="bool" jdbcType="BIT" javaType="java.lang.Boolean"/>
|
||||||
|
</parameterMap>
|
||||||
|
|
||||||
<parameterMap id="parameter_IdFromMap" class="map">
|
<parameterMap id="parameter_IdFromMap" class="map">
|
||||||
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
<parameter property="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||||
<parameter property="from" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
<parameter property="from" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
||||||
@@ -419,7 +423,17 @@
|
|||||||
(class_type = 'layereddirectory' or class_type = 'layeredfile') and
|
(class_type = 'layereddirectory' or class_type = 'layeredfile') and
|
||||||
store_new_id = ?
|
store_new_id = ?
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="select_AVMNodes_layeredDirectoriesAndPrimaryTF" parameterMap="parameter_BoolMap" resultMap="result_AVMNode">
|
||||||
|
select
|
||||||
|
*
|
||||||
|
from
|
||||||
|
avm_nodes
|
||||||
|
where
|
||||||
|
class_type = 'layereddirectory' and
|
||||||
|
primary_indirection = ?
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="select_AVMNodes_layeredFiles" resultMap="result_AVMNode">
|
<select id="select_AVMNodes_layeredFiles" resultMap="result_AVMNode">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
@@ -863,7 +877,18 @@
|
|||||||
where
|
where
|
||||||
parent_id = ?
|
parent_id = ?
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="select_AVMNodes_nullParentAndIsRootTF" parameterMap="parameter_BoolMap" resultMap="result_AVMNode">
|
||||||
|
select
|
||||||
|
an.*
|
||||||
|
from
|
||||||
|
avm_child_entries ce
|
||||||
|
right outer join avm_nodes an on (an.id = ce.child_id)
|
||||||
|
where
|
||||||
|
ce.parent_id is null and
|
||||||
|
an.is_root = ?
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<!-- AVM MergeLink Statements -->
|
<!-- AVM MergeLink Statements -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
@@ -34,26 +34,4 @@
|
|||||||
</selectKey>
|
</selectKey>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="select_AVMNodes_orphans" resultMap="result_AVMNode">
|
|
||||||
select
|
|
||||||
an.*
|
|
||||||
from
|
|
||||||
avm_child_entries ce
|
|
||||||
right outer join avm_nodes an on (an.id = ce.child_id)
|
|
||||||
where
|
|
||||||
ce.parent_id is null and
|
|
||||||
an.is_root = false
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="select_AVMNodes_layeredDirectories" resultMap="result_AVMNode">
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from
|
|
||||||
avm_nodes
|
|
||||||
where
|
|
||||||
class_type = 'layereddirectory' and
|
|
||||||
primary_indirection = true
|
|
||||||
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</sqlMap>
|
</sqlMap>
|
@@ -59,8 +59,8 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
|||||||
private static final String SELECT_AVM_NODES_NEW_LAYERED_IN_STORE = "alfresco.avm.select_AVMNodes_newLayeredInStore";
|
private static final String SELECT_AVM_NODES_NEW_LAYERED_IN_STORE = "alfresco.avm.select_AVMNodes_newLayeredInStore";
|
||||||
private static final String SELECT_AVM_NODE_IDS_NEW_LAYERED_IN_STORE = "alfresco.avm.select_AVMNodes_IDs_newLayeredInStore";
|
private static final String SELECT_AVM_NODE_IDS_NEW_LAYERED_IN_STORE = "alfresco.avm.select_AVMNodes_IDs_newLayeredInStore";
|
||||||
private static final String UPDATE_AVM_NODES_CLEAR_NEW_IN_STORE = "alfresco.avm.update_AVMNodes_clearNewInStore";
|
private static final String UPDATE_AVM_NODES_CLEAR_NEW_IN_STORE = "alfresco.avm.update_AVMNodes_clearNewInStore";
|
||||||
private static final String SELECT_AVM_NODES_ORPHANS = "alfresco.avm.select_AVMNodes_orphans";
|
private static final String SELECT_AVM_NODES_NULL_PARENT_AND_ISROOT_TF= "alfresco.avm.select_AVMNodes_nullParentAndIsRootTF";
|
||||||
private static final String SELECT_AVM_NODES_LAYERED_DIRECTORIES = "alfresco.avm.select_AVMNodes_layeredDirectories";
|
private static final String SELECT_AVM_NODES_LAYERED_DIRECTORIES_AND_PRIMARY_TF = "alfresco.avm.select_AVMNodes_layeredDirectoriesAndPrimaryTF";
|
||||||
private static final String SELECT_AVM_NODES_LAYERED_FILES = "alfresco.avm.select_AVMNodes_layeredFiles";
|
private static final String SELECT_AVM_NODES_LAYERED_FILES = "alfresco.avm.select_AVMNodes_layeredFiles";
|
||||||
private static final String SELECT_AVM_NODE_IDS_BY_ACL_ID = "alfresco.avm.select_AVMNodes_IDs_byAcl";
|
private static final String SELECT_AVM_NODE_IDS_BY_ACL_ID = "alfresco.avm.select_AVMNodes_IDs_byAcl";
|
||||||
|
|
||||||
@@ -168,14 +168,22 @@ public class AVMNodeDAOImpl extends AbstractAVMNodeDAOImpl
|
|||||||
@Override
|
@Override
|
||||||
protected List<AVMNodeEntity> getNodeEntityOrphans(int maxSize)
|
protected List<AVMNodeEntity> getNodeEntityOrphans(int maxSize)
|
||||||
{
|
{
|
||||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_ORPHANS, 0, maxSize);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
|
params.put("bool", false);
|
||||||
|
|
||||||
|
// all nodes with null parent and not a root
|
||||||
|
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_NULL_PARENT_AND_ISROOT_TF, params, 0, maxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
protected List<AVMNodeEntity> getAllLayeredDirectoryNodeEntities()
|
protected List<AVMNodeEntity> getAllLayeredDirectoryNodeEntities()
|
||||||
{
|
{
|
||||||
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_LAYERED_DIRECTORIES);
|
Map<String, Object> params = new HashMap<String, Object>(1);
|
||||||
|
params.put("bool", true);
|
||||||
|
|
||||||
|
// all primary layered directories
|
||||||
|
return (List<AVMNodeEntity>) template.queryForList(SELECT_AVM_NODES_LAYERED_DIRECTORIES_AND_PRIMARY_TF, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
Reference in New Issue
Block a user