insert into alf_access_control_list (version, acl_id, latest, acl_version, inherits, inherits_from, type, inherited_acl, is_versioned, requires_version, acl_change_set) values (#{version}, #{aclId}, #{latest}, #{aclVersion}, #{inherits}, #{inheritsFrom}, #{type}, #{inheritedAcl}, #{isVersioned}, #{requiresVersion}, #{aclChangeSet}) insert into alf_access_control_list (id, version, acl_id, latest, acl_version, inherits, inherits_from, type, inherited_acl, is_versioned, requires_version, acl_change_set) values (#{id}, #{version}, #{aclId}, #{latest}, #{aclVersion}, #{inherits}, #{inheritsFrom}, #{type}, #{inheritedAcl}, #{isVersioned}, #{requiresVersion}, #{aclChangeSet}) insert into alf_acl_member (version, acl_id, ace_id, pos) values (#{version}, #{aclId}, #{aceId}, #{pos}) insert into alf_acl_member (id, version, acl_id, ace_id, pos) values (#{id}, #{version}, #{aclId}, #{aceId}, #{pos}) insert into alf_acl_change_set (commit_time_ms) values (null) insert into alf_acl_change_set (id, commit_time_ms) values (#{id}, null) insert into alf_access_control_entry (version, permission_id, authority_id, allowed, applies, context_id) values (#{version}, #{permissionId}, #{authorityId}, #{allowed}, #{applies}, #{contextId}) insert into alf_access_control_entry (id, version, permission_id, authority_id, allowed, applies, context_id) values (#{id}, #{version}, #{permissionId}, #{authorityId}, #{allowed}, #{applies}, #{contextId}) insert into alf_ace_context (version, class_context, property_context, kvp_context) values (#{version}, #{classContext}, #{propertyContext}, #{kvpContext}) insert into alf_ace_context (id, version, class_context, property_context, kvp_context) values (#{id}, #{version}, #{classContext}, #{propertyContext}, #{kvpContext}) insert into alf_permission (version, type_qname_id, name) values (#{version}, #{typeQnameId}, #{name}) insert into alf_permission (id, version, type_qname_id, name) values (#{id}, #{version}, #{typeQnameId}, #{name}) insert into alf_authority (version, authority, crc) values (#{version}, #{authority}, #{crc}) insert into alf_authority (id, version, authority, crc) values (#{id}, #{version}, #{authority}, #{crc}) insert into alf_authority_alias (version, auth_id, alias_id) values (#{version}, #{authId}, #{aliasId}) insert into alf_authority_alias (id, version, auth_id, alias_id) values (#{id}, #{version}, #{authId}, #{aliasId}) update alf_access_control_list set acl_id = #{aclId}, latest = #{latest}, acl_version = #{aclVersion}, inherits = #{inherits}, inherits_from = #{inheritsFrom,jdbcType=BIGINT}, type = #{type}, inherited_acl = #{inheritedAcl,jdbcType=BIGINT}, is_versioned = #{isVersioned}, requires_version = #{requiresVersion}, acl_change_set = #{aclChangeSet,jdbcType=BIGINT}, version = #{version} where id = #{id} and version = (#{version} - 1) update alf_acl_change_set set commit_time_ms = #{commitTimeMs,jdbcType=BIGINT} where id = #{id} update alf_acl_member set acl_id = #{aclId}, ace_id = #{aceId}, pos = #{pos}, version = #{version} where id = #{id} and version = (#{version} - 1) update alf_authority set authority = #{authority}, crc = #{crc}, version = #{version} where id = #{id} and version = (#{version} - 1) update alf_permission set type_qname_id = #{typeQnameId}, name = #{name}, version = #{version} where id = #{id} and version = (#{version} - 1) delete from alf_access_control_list where id = ? delete from alf_access_control_list where id in #{item} delete from alf_access_control_entry where id in #{item} delete from alf_access_control_entry where id not in ( select distinct(m.ace_id) from alf_acl_member m ) delete from alf_acl_member where id in #{item} delete from alf_acl_member where acl_id = ? delete from alf_acl_member where acl_id in #{item} delete from alf_acl_change_set where id = ? delete from alf_ace_context where id = ? delete from alf_authority where id = ? delete from alf_authority_alias where id = ? delete from alf_permission where id = ?