QueueRepository

@Repository
interface QueueRepository : CrudRepository<Queue, Long> , JpaSpecificationExecutor<Queue>

DAO repository for working with "queue" db table

Functions

Link copied to clipboard
abstract fun count(@Nullable spec: Specification<Queue>): Long
abstract fun count(): Long
Link copied to clipboard
abstract fun delete(entity: Queue)
Link copied to clipboard
abstract fun deleteAll()
abstract fun deleteAll(entities: MutableIterable<Queue>)
Link copied to clipboard
abstract fun deleteAllById(ids: MutableIterable<Long>)
Link copied to clipboard
abstract fun deleteById(id: Long)
Link copied to clipboard
abstract fun exists(spec: Specification<Queue>): Boolean
Link copied to clipboard
abstract fun existsById(id: Long): Boolean
Link copied to clipboard
abstract fun findAll(@Nullable spec: Specification<Queue>): MutableList<Queue>
abstract fun findAll(@Nullable spec: Specification<Queue>, pageable: Pageable): Page<Queue>
abstract fun findAll(@Nullable spec: Specification<Queue>, sort: Sort): MutableList<Queue>
abstract fun findAll(): MutableIterable<Queue>
Link copied to clipboard
Link copied to clipboard
abstract fun findById(id: Long): Optional<Queue>
Link copied to clipboard
abstract fun findOne(@Nullable spec: Specification<Queue>): Optional<Queue>
Link copied to clipboard
@Query(value = " SELECT pin_code FROM queue WHERE pin_code IS NOT NULL; ", nativeQuery = true)
abstract fun findPinCodes(): List<String>

Returns list of existing pin codes

Link copied to clipboard
@Query(value = " SELECT qr_code FROM queue WHERE qr_code IS NOT NULL; ", nativeQuery = true)
abstract fun findQrCodes(): List<String>

Returns list of existing QR codes

Link copied to clipboard
@Query(value = " SELECT queue.queue_id queueId, queue.name queueName, queue.color queueColor, queue.is_important isImportant, queue.track_expenses trackExpenses FROM queue JOIN user_queue ON queue.queue_id = user_queue.queue_id WHERE queue.current_user_id = user_queue.user_id AND queue.current_user_id = (SELECT user_id FROM "user" WHERE token = :token) AND queue.queue_id in (SELECT queue_id FROM user_queue GROUP BY queue_id HAVING COUNT(*) > 1) ORDER BY queue.name, queue.is_important DESC; ", nativeQuery = true)
abstract fun findToDoTasks(token: String): List<QueueAndUserQueue>

Returns queues for which a particular user is on duty

Link copied to clipboard
abstract fun <S : Queue> save(entity: S): S
Link copied to clipboard
abstract fun <S : Queue> saveAll(entities: MutableIterable<S>): MutableIterable<S>