Applications
Repository
The ApplicationsRepository
interface
is useful to manage the queries for the application operations
Author
N7ghtm4r3 - Tecknobit
See also
JpaRepository
Functions
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + PLATFORMS_KEY + "(" +
APPLICATION_IDENTIFIER_KEY + "," +
PLATFORM_KEY + ")" +
" VALUES " + " ( " +
":" + APPLICATION_IDENTIFIER_KEY + "," +
":#{#" + PLATFORM_KEY + ".name()}" +
")",
nativeQuery = true
)
Method to connect a platform version for an
existing application
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""DELETE FROM " + APPLICATIONS_KEY +
" WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to delete an existing application
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + APPLICATIONS_KEY +
" SET " +
NAME_KEY + "=:" + NAME_KEY + "," +
DESCRIPTION_KEY + "=:" + DESCRIPTION_KEY +
" WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + APPLICATIONS_KEY +
" SET " +
NAME_KEY + "=:" + NAME_KEY + "," +
DESCRIPTION_KEY + "=:" + DESCRIPTION_KEY + "," +
APPLICATION_ICON_KEY + "=:" + APPLICATION_ICON_KEY +
" WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to edit an existing application
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = "SELECT DISTINCT a.* FROM " + APPLICATIONS_KEY + " AS a" +
" LEFT JOIN " + PLATFORMS_KEY + " as p ON" +
" p." + APPLICATION_IDENTIFIER_KEY + "=" + IDENTIFIER_KEY +
" WHERE " + NAME_KEY + " LIKE %:" + NAME_KEY + "%" +
" AND (" +
"COALESCE(:" + PLATFORMS_KEY + ") IS NULL OR " +
"p." + PLATFORM_KEY + " IN (:" + PLATFORMS_KEY + ")" +
") " +
" ORDER BY " + CREATION_DATE_KEY + " DESC",
nativeQuery = true
)
Method to execute the query to get the
applications list registered in the system
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + APPLICATIONS_KEY + "(" +
IDENTIFIER_KEY + "," +
CREATION_DATE_KEY + "," +
NAME_KEY + "," +
DESCRIPTION_KEY + "," +
APPLICATION_ICON_KEY +
")" + " VALUES " + " ( " +
":" + IDENTIFIER_KEY + "," +
":" + CREATION_DATE_KEY + "," +
":" + NAME_KEY + "," +
":" + DESCRIPTION_KEY + "," +
":" + APPLICATION_ICON_KEY +
")",
nativeQuery = true
)
Method to save and register a new
application in the system