mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
43735: Final part of ALF-14861 SOLR to scale for non-admin users in 100k sites and a subgroup of each of 1000 independent groupings with 1000 subgroups git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@44243 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
80 lines
4.1 KiB
XML
80 lines
4.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<!--
|
|
Queries related to authorities
|
|
-->
|
|
<mapper namespace="alfresco.query.authorities">
|
|
|
|
<!-- -->
|
|
<!-- Result Maps -->
|
|
<!-- -->
|
|
|
|
<resultMap id="result_AuthorityInfo" type="AuthorityInfo">
|
|
<id property="id" column="id" jdbcType="BIGINT" javaType="java.lang.Long"/>
|
|
<result property="authorityDisplayName" column="authority_display_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
|
<result property="authorityName" column="authority_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
|
<association property="node" resultMap="alfresco.node.result_Node"/>
|
|
</resultMap>
|
|
|
|
<resultMap id="result_AuthorityBridgeLink" type="AuthorityBridgeLink">
|
|
<result property="childName" column="child_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
|
<result property="parentName" column="parent_name" jdbcType="VARCHAR" javaType="java.lang.String"/>
|
|
</resultMap>
|
|
|
|
<!-- -->
|
|
<!-- Parameter Maps -->
|
|
<!-- -->
|
|
|
|
<!-- -->
|
|
<!-- Statements -->
|
|
<!-- -->
|
|
|
|
<!-- GetAuthorities - note: take advantage of fact that authority name is also on child assoc (including "username" for users, eg. getAllAuthoritiesInZone) -->
|
|
<select id="select_GetAuthoritiesCannedQuery" parameterType="AuthorityInfo" resultMap="result_AuthorityInfo" fetchSize="-2147483648">
|
|
select
|
|
childNode.id as id,
|
|
childStore.protocol as protocol,
|
|
childStore.identifier as identifier,
|
|
childNode.uuid as uuid,
|
|
adn.string_value as authority_display_name,
|
|
assoc.qname_localname as authority_name <!-- see note -->
|
|
from
|
|
alf_child_assoc assoc
|
|
join alf_node childNode on (childNode.id = assoc.child_node_id)
|
|
join alf_store childStore on (childStore.id = childNode.store_id)
|
|
left join alf_node_properties adn on (adn.node_id = childNode.id and adn.qname_id = #{authorityDisplayNameQNameId})
|
|
where
|
|
assoc.parent_node_id = #{parentNodeId}
|
|
</select>
|
|
|
|
<!-- Get all relationships between authorities -->
|
|
<select id="select_GetAuthorityBridgeEntries" parameterType="AuthorityBridgeParameters" resultMap="result_AuthorityBridgeLink" fetchSize="-2147483648">
|
|
select
|
|
ca.qname_localname as child_name,
|
|
parentName.string_value as parent_name
|
|
from
|
|
alf_child_assoc ca
|
|
join alf_node childNode on ((childNode.id = ca.child_node_id) and (childNode.type_qname_id = #{typeQNameId} )and (childNode.store_id = #{storeId}))
|
|
join alf_node parentNode on ((parentNode.id = ca.parent_node_id) and (parentNode.type_qname_id = #{typeQNameId}) and (parentNode.store_id = #{storeId}))
|
|
join alf_node_properties parentName on (parentName.node_id = parentNode.id and parentName.qname_id = #{authorityNameQNameId})
|
|
where
|
|
ca.type_qname_id = #{childAssocTypeQNameId}
|
|
</select>
|
|
|
|
<!-- Get direct parent authorities -->
|
|
<select id="select_GetDirectAuthoritiesForUser" parameterType="AuthorityBridgeParameters" resultMap="result_AuthorityBridgeLink" fetchSize="-2147483648">
|
|
select
|
|
'' as child_name,
|
|
parentName.string_value as parent_name
|
|
from
|
|
alf_child_assoc ca
|
|
join alf_node childNode on ((childNode.id = ca.child_node_id) and (childNode.store_id = #{storeId}))
|
|
join alf_node parentNode on ((parentNode.id = ca.parent_node_id) and (parentNode.type_qname_id = #{typeQNameId}) and (parentNode.store_id = #{storeId}))
|
|
join alf_node_properties parentName on (parentName.node_id = parentNode.id and parentName.qname_id = #{authorityNameQNameId})
|
|
where
|
|
ca.type_qname_id = #{childAssocTypeQNameId}
|
|
and childNode.id = #{nodeId}
|
|
</select>
|
|
|
|
</mapper> |