Applications Repository

@Repository
interface ApplicationsRepository : JpaRepository<T, ID>

The ApplicationsRepository interface is useful to manage the queries for the application operations

Author

N7ghtm4r3 - Tecknobit

See also

JpaRepository

Functions

Link copied to clipboard
@Modifying(clearAutomatically = true )
@Query(value = "INSERT INTO " + PLATFORMS_KEY + "(" + APPLICATION_IDENTIFIER_KEY + "," + PLATFORM_KEY + ")" + " VALUES " + " ( " + ":" + APPLICATION_IDENTIFIER_KEY + "," + ":#{#" + PLATFORM_KEY + ".name()}" + ")", nativeQuery = true )
abstract fun connectPlatform(@Param(value = "application_id") applicationId: String, @Param(value = "platform") platform: Platform)
Method to connect a platform version for an existing application
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
@Modifying(clearAutomatically = true )
@Query(value = ""DELETE FROM " + APPLICATIONS_KEY + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun deleteApplication(@Param(value = "id") applicationId: String)
Method to delete an existing application
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 = ""UPDATE " + APPLICATIONS_KEY + " SET " + NAME_KEY + "=:" + NAME_KEY + "," + DESCRIPTION_KEY + "=:" + DESCRIPTION_KEY + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun editApplication(@Param(value = "id") applicationId: String, @Param(value = "name") name: String, @Param(value = "description") description: String)
@Modifying(clearAutomatically = true )
@Query(value = ""UPDATE " + APPLICATIONS_KEY + " SET " + NAME_KEY + "=:" + NAME_KEY + "," + DESCRIPTION_KEY + "=:" + DESCRIPTION_KEY + "," + APPLICATION_ICON_KEY + "=:" + APPLICATION_ICON_KEY + " WHERE " + IDENTIFIER_KEY + "=:" + IDENTIFIER_KEY", nativeQuery = true )
abstract fun editApplication(@Param(value = "id") applicationId: String, @Param(value = "name") name: String, @Param(value = "description") description: String, @Param(value = "icon") icon: String)
Method to edit an existing application
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
@Query(value = "SELECT DISTINCT a.* FROM " + APPLICATIONS_KEY + " AS a" + " LEFT JOIN " + PLATFORMS_KEY + " as p ON" + " p." + APPLICATION_IDENTIFIER_KEY + "=" + IDENTIFIER_KEY + " WHERE " + NAME_KEY + " LIKE %:" + NAME_KEY + "%" + " AND (" + "COALESCE(:" + PLATFORMS_KEY + ") IS NULL OR " + "p." + PLATFORM_KEY + " IN (:" + PLATFORMS_KEY + ")" + ") " + " ORDER BY " + CREATION_DATE_KEY + " DESC", nativeQuery = true )
abstract fun getApplications(@Param(value = "name") name: String, @Param(value = "platforms") platforms: List<String>, pageable: Pageable): List<AmetistaApplication>
Method to execute the query to get the applications list registered in the system
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
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 " + APPLICATIONS_KEY + "(" + IDENTIFIER_KEY + "," + CREATION_DATE_KEY + "," + NAME_KEY + "," + DESCRIPTION_KEY + "," + APPLICATION_ICON_KEY + ")" + " VALUES " + " ( " + ":" + IDENTIFIER_KEY + "," + ":" + CREATION_DATE_KEY + "," + ":" + NAME_KEY + "," + ":" + DESCRIPTION_KEY + "," + ":" + APPLICATION_ICON_KEY + ")", nativeQuery = true )
abstract fun saveApplication(@Param(value = "id") applicationId: String, @Param(value = "creation_date") creationDate: Long, @Param(value = "name") name: String, @Param(value = "description") description: String, @Param(value = "icon") icon: String)
Method to save and register a new application in the system