GroupRepository

@Repository
interface GroupRepository : JpaRepository<ContactGroup, String> (source)

Repositório para operações de Grupos de Contatos. Grupos são usados para agrupar contatos para envio de campanhas em massa.

Functions

Link copied to clipboard
abstract fun count(): Long
abstract fun <S : ContactGroup> count(example: Example<S>): Long
Link copied to clipboard
@Query(value = "SELECT COUNT(c) FROM ContactGroup g JOIN g.contacts c WHERE g.id = :groupId")
abstract fun countContactsByGroupId(groupId: String): Long
Link copied to clipboard
abstract fun delete(entity: ContactGroup)
Link copied to clipboard
abstract fun deleteAll()
abstract fun deleteAll(entities: MutableIterable<ContactGroup>)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun deleteAllInBatch()
Link copied to clipboard
abstract fun deleteById(id: String)
Link copied to clipboard
Link copied to clipboard
abstract fun <S : ContactGroup> exists(example: Example<S>): Boolean
Link copied to clipboard
abstract fun existsById(id: String): Boolean
Link copied to clipboard
abstract override fun <S : ContactGroup> findAll(example: Example<S>): MutableList<S>
abstract override fun <S : ContactGroup> findAll(example: Example<S>, sort: Sort): MutableList<S>
abstract override fun findAll(): MutableList<ContactGroup>
abstract override fun findAll(sort: Sort): MutableList<ContactGroup>
abstract fun findAll(pageable: Pageable): Page<ContactGroup>
abstract fun <S : ContactGroup> findAll(example: Example<S>, pageable: Pageable): Page<S>
Link copied to clipboard
Link copied to clipboard
abstract fun <S : ContactGroup, R : Any> findBy(example: Example<S>, queryFunction: Function<FluentQuery.FetchableFluentQuery<S>, R>): R
Link copied to clipboard
abstract fun findById(id: String): Optional<ContactGroup>
Link copied to clipboard
@Query(value = "SELECT DISTINCT g FROM ContactGroup g LEFT JOIN FETCH g.contacts WHERE g.id = :id AND g.tenantId = :tenantId AND g.deletedAt IS NULL")
abstract fun findByIdWithContacts(id: String, tenantId: String): ContactGroup?
Link copied to clipboard
@Query(value = "SELECT g FROM ContactGroup g JOIN g.contacts c WHERE c.id = :contactId AND g.deletedAt IS NULL")
abstract fun findGroupsByContactId(contactId: String): List<ContactGroup>
Link copied to clipboard
abstract fun <S : ContactGroup> findOne(example: Example<S>): Optional<S>
Link copied to clipboard
abstract fun flush()
Link copied to clipboard
abstract fun getById(id: String): ContactGroup
Link copied to clipboard
abstract fun getOne(id: String): ContactGroup
Link copied to clipboard
Link copied to clipboard
abstract fun <S : ContactGroup> save(entity: S): S
Link copied to clipboard
abstract override fun <S : ContactGroup> saveAll(entities: MutableIterable<S>): MutableList<S>
Link copied to clipboard
Link copied to clipboard
abstract fun <S : ContactGroup> saveAndFlush(entity: S): S