NotificationsRepository
The NotificationsRepository
interface is useful to manage the queries for the notifications of the users
Author
N7ghtm4r3 - Tecknobit
See also
JpaRepository
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = ""SELECT * FROM " + NOTIFICATIONS_KEY + " WHERE " + USER_KEY + "=:" + USER_KEY", nativeQuery = true)
Method to execute the query to select all the notifications of a user
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = "INSERT INTO " + NOTIFICATIONS_KEY
+ " ("
+ IDENTIFIER_KEY + ","
+ LOGO_URL_KEY + ","
+ RELEASE_IDENTIFIER_KEY + ","
+ RELEASE_VERSION_KEY + ","
+ RELEASE_STATUS_KEY + ","
+ USER_KEY
+ " )"
+ " VALUES ("
+ ":" + IDENTIFIER_KEY + ","
+ ":" + LOGO_URL_KEY + ","
+ ":" + RELEASE_IDENTIFIER_KEY + ","
+ ":" + RELEASE_VERSION_KEY + ","
+ ":" + RELEASE_STATUS_KEY + ","
+ ":" + USER_KEY + ")", nativeQuery = true)
Method to execute the query to insert a new NovaNotification
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = "INSERT INTO " + NOTIFICATIONS_KEY
+ " ("
+ IDENTIFIER_KEY + ","
+ LOGO_URL_KEY + ","
+ USER_KEY
+ " )"
+ " VALUES ("
+ ":" + IDENTIFIER_KEY + ","
+ ":" + LOGO_URL_KEY + ","
+ ":" + USER_KEY + ")", nativeQuery = true)
Method to execute the query to insert a new NovaNotification when a project has been deleted
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = "INSERT INTO " + NOTIFICATIONS_KEY
+ " ("
+ IDENTIFIER_KEY + ","
+ LOGO_URL_KEY + ","
+ RELEASE_VERSION_KEY + ","
+ USER_KEY
+ " )"
+ " VALUES ("
+ ":" + IDENTIFIER_KEY + ","
+ ":" + LOGO_URL_KEY + ","
+ ":" + RELEASE_VERSION_KEY + ","
+ ":" + USER_KEY + ")", nativeQuery = true)
Method to execute the query to insert a new NovaNotification when a release has been deleted
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = "DELETE FROM " + NOTIFICATIONS_KEY + " WHERE " + USER_KEY + "=:" + USER_KEY
+ " AND " + RELEASE_IDENTIFIER_KEY + "=:" + RELEASE_IDENTIFIER_KEY + " AND " + IS_SENT_KEY
+ "='" + 1 + "'", nativeQuery = true)
Method to execute the query to set as red all the notifications of a user deleting the related records
Link copied to clipboard
@Modifying(clearAutomatically = true)
@Query(value = "UPDATE " + NOTIFICATIONS_KEY + " SET "
+ IS_SENT_KEY + "='" + 1
+ "' WHERE " + USER_KEY + "=:" + USER_KEY + " AND " + IS_SENT_KEY + "='" + 0 + "'", nativeQuery = true)
Method to execute the query to set as sent all the notifications of a user