Passwords Repository

@Repository
interface PasswordsRepository : JpaRepository<T, ID>

The PasswordsRepository interface is useful to manage the queries for the passwords operations

Author

N7ghtm4r3 - Tecknobit

See also

JpaRepository

Functions

Link copied to clipboard
abstract fun <S : T?> count(example: Example<S>): Long
Link copied to clipboard
@Query(value = "SELECT COUNT(*) FROM " + PASSWORDS_KEY + _WHERE_ + USER_IDENTIFIER_KEY + "=:" + USER_IDENTIFIER_KEY + " AND " + TYPE_KEY + " IN (:" + TYPE_KEY + ")", nativeQuery = true )
abstract fun countPasswords(@Param(value = "user_id") userId: String, @Param(value = "type") types: Set<String>): Long
Query used to count the total passwords
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
@Query(value = ""DELETE FROM " + PASSWORDS_KEY + _WHERE_ + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun deletePassword(@Param(value = "id") passwordId: String)
Query used to delete a password
Link copied to clipboard
@Modifying
@Query(value = ""UPDATE " + PASSWORDS_KEY + " SET " + TAIL_KEY + "=:" + TAIL_KEY + "," + SCOPES_KEY + "=:" + SCOPES_KEY + _WHERE_ + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun editGeneratedPassword(    @Param(value = "tail") tail: String,     @Param(value = "scopes") scopes: String,     @Param(value = "id") passwordId: String)
Query used to edit a GENERATED password
Link copied to clipboard
@Modifying
@Query(value = ""UPDATE " + PASSWORDS_KEY + " SET " + TAIL_KEY + "=:" + TAIL_KEY + "," + SCOPES_KEY + "=:" + SCOPES_KEY + "," + PASSWORD_KEY + "=:" + PASSWORD_KEY + _WHERE_ + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun editInsertedPassword(    @Param(value = "tail") tail: String,     @Param(value = "scopes") scopes: String,     @Param(value = "password") password: String,     @Param(value = "id") passwordId: String)
Query used to edit a INSERTED password
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
@Query(value = "SELECT * FROM " + PASSWORDS_KEY + _WHERE_ + USER_IDENTIFIER_KEY + "=:" + USER_IDENTIFIER_KEY + " AND " + TYPE_KEY + " IN (:" + TYPE_KEY + ")", nativeQuery = true )
abstract fun getPasswords(    @Param(value = "user_id") userId: String,     @Param(value = "type") types: Set<String>,     pageable: Pageable): List<Password>
Query used to retrieve the passwords of the user
Link copied to clipboard
abstract fun getReferenceById(id: ID): T
Link copied to clipboard
@Modifying
@Query(value = ""UPDATE " + PASSWORDS_KEY + " SET " + PASSWORD_KEY + "=:" + PASSWORD_KEY + _WHERE_ + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun refreshPassword(@Param(value = "password") password: String, @Param(value = "id") passwordId: String)
Query used to refresh a GENERATED password
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