Updates Repository

@Repository
interface UpdatesRepository : JpaRepository<T, ID>

The UpdatesRepository interface is useful to manage the queries for the updates of a project

Author

N7ghtm4r3 - Tecknobit

See also

JpaRepository

Functions

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
open fun deleteInBatch(entities: Iterable<T>)
Link copied to clipboard
@Modifying(clearAutomatically = true )
@Query(value = ""DELETE FROM " + UPDATES_KEY + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun deleteUpdate(@Param(value = "id") updateId: String)
Method to execute the query to delete an existing ProjectUpdate
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
abstract fun getOne(id: ID): T
Link copied to clipboard
abstract fun getReferenceById(id: ID): T
Link copied to clipboard
@Query(value = ""SELECT * FROM " + UPDATES_KEY + " WHERE " + PROJECT_KEY + "=:" + PROJECT_KEY + " AND " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun getUpdateById(@Param(value = "project") projectId: String, @Param(value = "id") updateId: String): ProjectUpdate
Method to execute the query to select a ProjectUpdate by its id
Link copied to clipboard
@Query(value = ""SELECT * FROM " + UPDATES_KEY + " WHERE " + PROJECT_KEY + "=:" + PROJECT_KEY + " AND " + UPDATE_TARGET_VERSION_KEY + "=:" + UPDATE_TARGET_VERSION_KEY", nativeQuery = true )
abstract fun getUpdateByVersion(@Param(value = "project") projectId: String, @Param(value = "target_version") targetVersion: String): ProjectUpdate
Method to execute the query to select a ProjectUpdate by its target project_version
Link copied to clipboard
@Modifying(clearAutomatically = true )
@Query(value = ""UPDATE " + UPDATES_KEY + " SET " + UPDATE_PUBLISH_DATE_KEY + "=:" + UPDATE_PUBLISH_DATE_KEY + "," + UPDATE_PUBLISHED_BY_KEY + "=:" + UPDATE_PUBLISHED_BY_KEY + "," + UPDATE_STATUS_KEY + "= 'PUBLISHED'" + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun publishUpdate(@Param(value = "id") updateId: String, @Param(value = "publish_date") publishDate: Long, @Param(value = "published_by") publishedBy: String)
Method to execute the query to publish an existing com.tecknobit.pandoro.services.projects.entities.ProjectUpdate
Link copied to clipboard
@Modifying(clearAutomatically = true )
@Query(value = ""UPDATE " + UPDATES_KEY + " SET " + AUTHOR_KEY + "=NULL," + UPDATE_STARTED_BY_KEY + "=NULL," + UPDATE_PUBLISHED_BY_KEY + "=NULL" + " WHERE " + AUTHOR_KEY + "=:" + IDENTIFIER_KEY + " OR " + UPDATE_STARTED_BY_KEY + "=:" + IDENTIFIER_KEY + " OR " + UPDATE_PUBLISHED_BY_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun removeUserConstraints(@Param(value = "id") userId: String)
Method to execute the query to remove the constraints between PandoroUser deleted and ProjectUpdate
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
Link copied to clipboard
@Modifying(clearAutomatically = true )
@Query(value = "INSERT INTO " + UPDATES_KEY + "( " + IDENTIFIER_KEY + "," + UPDATE_TARGET_VERSION_KEY + "," + UPDATE_CREATE_DATE_KEY + "," + UPDATE_PUBLISH_DATE_KEY + "," + UPDATE_START_DATE_KEY + "," + UPDATE_STATUS_KEY + "," + PROJECT_KEY + "," + AUTHOR_KEY + "," + UPDATE_PUBLISHED_BY_KEY + "," + UPDATE_STARTED_BY_KEY + ") VALUES " + "( " + ":" + IDENTIFIER_KEY + "," + ":" + UPDATE_TARGET_VERSION_KEY + "," + ":" + UPDATE_CREATE_DATE_KEY + "," + "-1," + "-1," + ":#{#" + UPDATE_STATUS_KEY + ".name()}," + ":" + PROJECT_KEY + "," + ":" + AUTHOR_KEY + "," + "NULL," + "NULL)", nativeQuery = true )
abstract fun scheduleUpdate(@Param(value = "id") updateId: String, @Param(value = "target_version") targetVersion: String, @Param(value = "create_date") createDate: Long, @Param(value = "status") updateStatus: UpdateStatus, @Param(value = "project") projectId: String, @Param(value = "author") author: String)
Method to execute the query to schedule a new ProjectUpdate
Link copied to clipboard
@Modifying(clearAutomatically = true )
@Query(value = ""UPDATE " + UPDATES_KEY + " SET " + UPDATE_START_DATE_KEY + "=:" + UPDATE_START_DATE_KEY + "," + UPDATE_STARTED_BY_KEY + "=:" + UPDATE_STARTED_BY_KEY + "," + UPDATE_STATUS_KEY + "= 'IN_DEVELOPMENT'" + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun startUpdate(@Param(value = "id") updateId: String, @Param(value = "start_date") startDate: Long, @Param(value = "started_by") startedBy: String)
Method to execute the query to start an existing ProjectUpdate