select max(id) from avm_nodes
select max(id) from alf_node
= #{idOne}
and id < #{idTwo}
and class_type = 'plainfile'
and content_url is not null
and content_url not like 'id:%'
order by
id ASC
]]>
= #{idOne}
and node_id < #{idTwo}
and actual_type_n = 11
order by
node_id ASC
]]>
select
authority,
crc
from
alf_authority
select count(*) from alf_child_assoc
select max(id) from alf_child_assoc
= #{idTwo} and
ca.id < #{idThree}
order by
ca.id ASC
]]>
select
s.protocol,
s.identifier,
n.uuid,
np.string_value as name
from
alf_node n
join alf_store s on (s.id = n.store_id)
join alf_node_properties np on (np.node_id = n.id)
where
n.type_qname_id = #{typeQNameId} and
np.qname_id = #{propQNameId} and
np.string_value like #{namePattern}
select
ma.mkey as tenantDomain,
a2.bool_value as isEnabled,
a3.string_value as rootDir
from
alf_global_attributes ga
join alf_map_attribute_entries ma on (ma.map_id = ga.attribute)
join alf_map_attribute_entries ma2 on (ma2.map_id = ma.attribute_id and ma2.mkey = 'enabled')
join alf_attributes a2 on (a2.id = ma2.attribute_id)
join alf_map_attribute_entries ma3 on (ma3.map_id = ma.attribute_id and ma3.mkey = 'rootContentStoreDir')
join alf_attributes a3 on (a3.id = ma3.attribute_id)
where
ga.name = 'alfresco-tenants'
select
ma2.mkey as wpStoreId,
a4.string_value as relPath,
a5.string_value as avmStore,
a6.string_value as owner1
from
alf_global_attributes ga
join alf_map_attribute_entries ma on (ma.map_id = ga.attribute)
join alf_map_attribute_entries ma2 on (ma2.map_id = ma.attribute_id)
join alf_map_attribute_entries ma3 on (ma3.map_id = ma2.attribute_id)
join alf_map_attribute_entries ma4 on (ma4.map_id = ma3.attribute_id and ma4.mkey = 'path')
join alf_attributes a4 on (a4.id = ma4.attribute_id)
join alf_map_attribute_entries ma5 on (ma5.map_id = ma3.attribute_id and ma5.mkey = 'store')
join alf_attributes a5 on (a5.id = ma5.attribute_id)
join alf_map_attribute_entries ma6 on (ma6.map_id = ma3.attribute_id and ma6.mkey = 'owners')
join alf_list_attribute_entries la6 on (la6.list_id = ma6.attribute_id and la6.mindex = 0)
join alf_attributes a6 on (a6.id = la6.attribute_id)
where
ga.name = '.avm_lock_table'
select
ma.mkey as componentName,
ma2.mkey as propName,
a2.string_value as propValue
from
alf_global_attributes ga
join alf_map_attribute_entries ma on (ma.map_id = ga.attribute)
join alf_map_attribute_entries ma2 on (ma2.map_id = ma.attribute_id)
join alf_attributes a2 on (a2.id = ma2.attribute_id)
where
ga.name = '.PropertyBackedBeans'
select
ma.mkey as label,
ma2.mkey as zoneId,
a2.long_value as lastModified
from
alf_global_attributes ga
join alf_map_attribute_entries ma on (ma.map_id = ga.attribute)
join alf_map_attribute_entries ma2 on (ma2.map_id = ma.attribute_id)
join alf_attributes a2 on (a2.id = ma2.attribute_id)
where
ga.name = '.ChainingUserRegistrySynchronizer'
select
ga.name as name
from
alf_global_attributes ga
where
name not in ('alfresco-tenants', '.href', '.avm_lock_table', '.PropertyBackedBeans', '.ChainingUserRegistrySynchronizer')
select
id
from
alf_access_control_list
select acl_id from avm_nodes where acl_id is not null
union select acl_id from avm_stores where acl_id is not null
union select acl_id from alf_node where acl_id is not null
union select acl_id from alf_attributes where acl_id is not null
select
max(acl.id)
from
alf_access_control_list acl
select
count(*)
from
alf_node
select
count(*)
from
alf_node
where
acl_id > ?
1
) entities
where
(ce.parent_id = entities.parent_id)
and (lower(ce.name) = entities.lname)
order by
parent_id, lower(name), child_id
]]>
childAcl.inherits_from
AND NOT EXISTS (
select 1 from alf_acl_member childMem
where
childMem.acl_id = childAcl.id
and childMem.ace_id = mem.ace_id
and childMem.pos = mem.pos + 2
)
)
]]>
childAcl.id
AND acl.id <> childAcl.inherits_from
AND acl.inherited_acl <> childAcl.inherits_from
)
]]>
acl.id
)
]]>
update
alf_node_properties
set
actual_type_n = 21,
persisted_type_n = 3,
long_value = ?,
string_value = null
where
node_id = ?
and qname_id = ?
and list_index = ?
and locale_id = ?
update
alf_content_data
set
content_mimetype_id = ?
where
content_mimetype_id = ?
update
alf_child_assoc
set
child_node_name_crc = ?,
qname_crc = ?
where
id = ?
update
avm_child_entries
set
name = ?
where
child_id = ?
and parent_id = ?
INSERT INTO alf_node_properties
(
node_id, actual_type_n, persisted_type_n,
boolean_value,
long_value,
double_value,
float_value,
string_value,
serializable_value,
qname_id, list_index, locale_id)
SELECT
n.id, 0, 0,
#{false},
0,
0,
0,
null,
null,
#{sizeCurrentQNameId}, -1, #{defaultLocaleId}
FROM
alf_node n
WHERE
n.type_qname_id = #{personTypeQNameId}
AND NOT EXISTS
(
SELECT 1 FROM alf_node_properties np
WHERE np.node_id = n.id
AND np.qname_id = #{sizeCurrentQNameId}
)
drop table alf_list_attribute_entries
drop table alf_map_attribute_entries
drop table alf_global_attributes
drop table alf_attributes
drop sequence alf_attributes_seq