Changelogs
Repository
The ChangelogsRepository
interface is
useful to manage the queries for the changelogs
Author
N7ghtm4r3 - Tecknobit
See also
JpaRepository
Functions
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + CHANGELOGS_KEY
+ "( "
+ IDENTIFIER_KEY + ","
+ CHANGELOG_EVENT_KEY + ","
+ CHANGELOG_EXTRA_CONTENT_KEY + ","
+ CHANGELOG_READ_KEY + ","
+ CHANGELOG_TIMESTAMP_KEY + ","
+ GROUP_IDENTIFIER_KEY + ","
+ CHANGELOG_OWNER_KEY + ") VALUES "
+ "( "
+ ":" + IDENTIFIER_KEY + ","
+ ":#{#" + CHANGELOG_EVENT_KEY + ".name()},"
+ ":" + CHANGELOG_EXTRA_CONTENT_KEY + ","
+ "false,"
+ ":" + CHANGELOG_TIMESTAMP_KEY + ","
+ ":" + GROUP_IDENTIFIER_KEY + ","
+ ":" + CHANGELOG_OWNER_KEY + ")",
nativeQuery = true
)
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = "INSERT INTO " + CHANGELOGS_KEY
+ "( "
+ IDENTIFIER_KEY + ","
+ CHANGELOG_EVENT_KEY + ","
+ CHANGELOG_EXTRA_CONTENT_KEY + ","
+ CHANGELOG_READ_KEY + ","
+ CHANGELOG_TIMESTAMP_KEY + ","
+ PROJECT_IDENTIFIER_KEY + ","
+ CHANGELOG_OWNER_KEY + ") VALUES "
+ "( "
+ ":" + IDENTIFIER_KEY + ","
+ ":#{#" + CHANGELOG_EVENT_KEY + ".name()},"
+ ":" + CHANGELOG_EXTRA_CONTENT_KEY + ","
+ "false,"
+ ":" + CHANGELOG_TIMESTAMP_KEY + ","
+ ":" + PROJECT_IDENTIFIER_KEY + ","
+ ":" + CHANGELOG_OWNER_KEY + ")",
nativeQuery = true
)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""DELETE FROM " + CHANGELOGS_KEY + " WHERE "
+ CHANGELOG_OWNER_KEY + "=:" + CHANGELOG_OWNER_KEY + " AND "
+ IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to delete a Changelog
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = ""SELECT * FROM " + CHANGELOGS_KEY + " WHERE " + IDENTIFIER_KEY + "=:"
+ IDENTIFIER_KEY + " AND " + CHANGELOG_OWNER_KEY + "=:" + CHANGELOG_OWNER_KEY",
nativeQuery = true
)
Method to execute the query to select the a
Changelog
Link copied to clipboard
@Query(value = "SELECT * FROM " + CHANGELOGS_KEY + " WHERE " + CHANGELOG_OWNER_KEY + "=:" + CHANGELOG_OWNER_KEY
+ " ORDER BY " + CHANGELOG_TIMESTAMP_KEY + " DESC ",
nativeQuery = true
)
Method to execute the query to select the
list of a Changelog
Link copied to clipboard
@Query(value = ""SELECT COUNT(*) FROM " + CHANGELOGS_KEY +
" WHERE " + CHANGELOG_OWNER_KEY +
"=:" + CHANGELOG_OWNER_KEY",
nativeQuery = true
)
Method to execute the query to get the total
number of the changelogs owned by the user
Link copied to clipboard
Link copied to clipboard
@Query(value = ""SELECT COUNT(*) FROM " + CHANGELOGS_KEY +
" WHERE " + CHANGELOG_OWNER_KEY + "=:" + CHANGELOG_OWNER_KEY +
" AND " + CHANGELOG_READ_KEY + "=" + false",
nativeQuery = true
)
Method to execute the query to count the Changelog
yet to read
Link copied to clipboard
@Modifying(clearAutomatically = true
)
@Query(value = ""UPDATE " + CHANGELOGS_KEY + " SET " + CHANGELOG_READ_KEY + "=true WHERE "
+ CHANGELOG_OWNER_KEY + "=:" + CHANGELOG_OWNER_KEY + " AND "
+ IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY",
nativeQuery = true
)
Method to execute the query to mark as read
a
Changelog
Link copied to clipboard
Link copied to clipboard