Changelogs Repository

@Repository
interface ChangelogsRepository : JpaRepository<T, ID>

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 )
abstract fun addGroupChangelog(@Param(value = "id") changelogId: String, @Param(value = "changelog_event") changelogEvent: ChangelogEvent, @Param(value = "extra_content") extraContent: String, @Param(value = "timestamp") changelogTimestamp: Long, @Param(value = "group_id") groupId: String, @Param(value = "owner") owner: String)
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 )
abstract fun addProjectChangelog(@Param(value = "id") changelogId: String, @Param(value = "changelog_event") changelogEvent: ChangelogEvent, @Param(value = "extra_content") extraContent: String, @Param(value = "timestamp") changelogTimestamp: Long, @Param(value = "project_id") projectId: String, @Param(value = "owner") owner: String)
Link copied to clipboard
abstract fun <S : T?> count(example: Example<S>): Long
Link copied to clipboard
abstract fun delete(entity: T)
Link copied to clipboard
abstract fun deleteAll(entities: Iterable<out T>)
Link copied to clipboard
abstract fun deleteAllById(ids: Iterable<out ID>)
Link copied to clipboard
abstract fun deleteAllByIdInBatch(ids: Iterable<ID>)
Link copied to clipboard
abstract fun deleteAllInBatch(entities: Iterable<T>)
Link copied to clipboard
abstract fun deleteById(id: ID)
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 )
abstract fun deleteChangelog(@Param(value = "owner") owner: String, @Param(value = "id") changelogId: String)
Method to execute the query to delete a Changelog
Link copied to clipboard
open fun deleteInBatch(entities: Iterable<T>)
Link copied to clipboard
abstract fun <S : T?> exists(example: Example<S>): Boolean
Link copied to clipboard
abstract fun existsById(id: ID): Boolean
Link copied to clipboard
abstract fun <S : T?> findAll(example: Example<S>): List<S>
abstract fun findAll(): Iterable<T>
abstract fun findAll(): List<T>
abstract fun findAll(pageable: Pageable): Page<T>
abstract fun <S : T?> findAll(example: Example<S>): Iterable<S>
abstract fun <S : T?> findAll(example: Example<S>, pageable: Pageable): Page<S>
Link copied to clipboard
abstract fun findAllById(ids: Iterable<ID>): Iterable<T>
abstract fun findAllById(ids: Iterable<ID>): List<T>
Link copied to clipboard
abstract fun <S : T?, R> findBy(example: Example<S>, queryFunction: (FluentQuery.FetchableFluentQuery<S>) -> R): R
Link copied to clipboard
abstract fun findById(id: ID): Optional<T>
Link copied to clipboard
abstract fun <S : T?> findOne(example: Example<S>): Optional<S>
Link copied to clipboard
abstract fun flush()
Link copied to clipboard
abstract fun getById(id: ID): T
Link copied to clipboard
@Query(value = ""SELECT * FROM " + CHANGELOGS_KEY + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY + " AND " + CHANGELOG_OWNER_KEY + "=:" + CHANGELOG_OWNER_KEY", nativeQuery = true )
abstract fun getChangelog(@Param(value = "id") changelogId: String, @Param(value = "owner") owner: String): Changelog
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 )
abstract fun getChangelogs(@Param(value = "owner") owner: String, pageable: Pageable): List<Changelog>
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 )
abstract fun getChangelogsCount(@Param(value = "owner") owner: String): Long
Method to execute the query to get the total number of the changelogs owned by the user
Link copied to clipboard
abstract fun getOne(id: ID): T
Link copied to clipboard
abstract fun getReferenceById(id: ID): T
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 )
abstract fun getUnreadChangelogsCount(@Param(value = "owner") owner: String): Long
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 )
abstract fun markAsRead(@Param(value = "owner") owner: String, @Param(value = "id") changelogId: String)
Method to execute the query to mark as read a Changelog
Link copied to clipboard
abstract fun <S : T?> save(entity: S): S
Link copied to clipboard
abstract fun <S : T?> saveAll(entities: Iterable<S>): Iterable<S>
abstract fun <S : T?> saveAll(entities: Iterable<S>): List<S>
Link copied to clipboard
abstract fun <S : T?> saveAllAndFlush(entities: Iterable<S>): List<S>
Link copied to clipboard
abstract fun <S : T?> saveAndFlush(entity: S): S