insert into alf_mimetype (version, mimetype_str) values (#{version}, #{mimetype}) insert into alf_mimetype (id, version, mimetype_str) values (#{id}, #{version}, #{mimetype}) insert into alf_encoding (version, encoding_str) values (#{version}, #{encoding}) insert into alf_encoding (id, version, encoding_str) values (#{id}, #{version}, #{encoding}) insert into alf_content_url (content_url, content_url_short, content_url_crc, content_size, orphan_time) values (?, ?, ?, ?, ?) insert into alf_content_url (id, content_url, content_url_short, content_url_crc, content_size, orphan_time) values (#{id}, #{contentUrl}, #{contentUrlShort}, #{contentUrlCrc}, #{size}, #{orphanTime,jdbcType=BIGINT}) insert into alf_content_data (version, content_url_id, content_mimetype_id, content_encoding_id, content_locale_id) values (?, ?, ?, ?, ?) insert into alf_content_data (id, version, content_url_id, content_mimetype_id, content_encoding_id, content_locale_id) values (#{id}, #{version}, #{contentUrlId,jdbcType=BIGINT}, #{mimetypeId,jdbcType=BIGINT}, #{encodingId,jdbcType=BIGINT}, #{localeId,jdbcType=BIGINT}) update alf_mimetype set mimetype_str = #{mimetype} where id = #{id} and version = (#{version} - 1) update alf_content_url set orphan_time = #{orphanTime,jdbcType=BIGINT} where id = #{id} and orphan_time is null orphan_time = #{oldOrphanTime} delete from alf_content_url where id in #{item} update alf_content_data set version = #{version}, content_url_id = #{contentUrlId,jdbcType=BIGINT}, content_mimetype_id = #{mimetypeId,jdbcType=BIGINT}, content_encoding_id = #{encodingId,jdbcType=BIGINT}, content_locale_id = #{localeId,jdbcType=BIGINT} where id = #{id} and version = (#{version} - 1) delete from alf_content_data where id = ?