saveLink

@Modifying(clearAutomatically = true)
@Query(value = "INSERT INTO " + LINKS_KEY + "(" + DISCRIMINATOR_VALUE_KEY + "," + LINK_IDENTIFIER_KEY + "," + TITLE_KEY + "," + DESCRIPTION_KEY + "," + REFERENCE_LINK_KEY + "," + CREATION_DATE_KEY + "," + EXPIRED_TIME_KEY + "," + UNIQUE_ACCESS_KEY + "," + PREVIEW_TOKEN_KEY + "," + OWNER_KEY + ") VALUES (" + ":" + DISCRIMINATOR_VALUE_KEY + "," + ":" + LINK_IDENTIFIER_KEY + "," + ":" + TITLE_KEY + "," + ":" + DESCRIPTION_KEY + "," + ":" + REFERENCE_LINK_KEY + "," + ":" + CREATION_DATE_KEY + "," + ":#{#" + EXPIRED_TIME_KEY + ".name()}," + ":" + UNIQUE_ACCESS_KEY + "," + ":" + PREVIEW_TOKEN_KEY + "," + ":" + OWNER_KEY + ")", nativeQuery = true)
abstract fun saveLink(@Param(value = "dtype") discriminatorValue: String, @Param(value = "link_id") linkId: String, @Param(value = "title") title: String, @Param(value = "description") description: String, @Param(value = "reference_link") referenceLink: String, @Param(value = "creation_date") creationDate: Long, @Param(value = "expired_time") expiredTime: CustomRefyLink.ExpiredTime, @Param(value = "unique_access") hasUniqueAccess: Boolean, @Param(value = "preview_token") previewToken: String, @Param(value = "owner") owner: String)

Method to execute the query to save a link

Parameters

discriminatorValue

: the discriminator value

linkId

: the identifier of the link

title

: the title of the link

description

: the description of the link

referenceLink

: the reference link value

creationDate

: when the link has been created

expiredTime

: the expiration time set for the link

hasUniqueAccess

: whether the link has the unique access

previewToken

: the token used to access to the custom link in preview mode

owner

: the owner of the link