save
Link
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + LINKS_KEY + "(" +
DISCRIMINATOR_VALUE_KEY + "," +
LINK_IDENTIFIER_KEY + "," +
TITLE_KEY + "," +
DESCRIPTION_KEY + "," +
REFERENCE_LINK_KEY + "," +
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 + "," +
":" + DATE_KEY + "," +
":#{#" + EXPIRED_TIME_KEY + ".name()}," +
":" + UNIQUE_ACCESS_KEY + "," +
":" + PREVIEW_TOKEN_KEY + "," +
":" + OWNER_KEY +
")",
nativeQuery = true
)
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