Package io.meeds.appcenter.dao
Interface FavoriteApplicationDAO
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<FavoriteApplicationEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<FavoriteApplicationEntity,,Long> org.springframework.data.repository.ListCrudRepository<FavoriteApplicationEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<FavoriteApplicationEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<FavoriteApplicationEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<FavoriteApplicationEntity>,org.springframework.data.repository.Repository<FavoriteApplicationEntity,Long>
public interface FavoriteApplicationDAO
extends org.springframework.data.jpa.repository.JpaRepository<FavoriteApplicationEntity,Long>
-
Method Summary
Modifier and TypeMethodDescriptionlongcountFavoritesForUser(String username) getFavoriteAppByUserNameAndAppId(Long applicationId, String userName) voidremoveAllFavoritesOfApplication(Long applicationId) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
getFavoriteAppByUserNameAndAppId
@Query("SELECT distinct(favoriteApp) FROM FavoriteApplicationEntity favoriteApp\nWHERE favoriteApp.application.id = ?1\nAND favoriteApp.userName = ?2\n") FavoriteApplicationEntity getFavoriteAppByUserNameAndAppId(Long applicationId, String userName) -
countFavoritesForUser
@Query("SELECT count(*) FROM FavoriteApplicationEntity favoriteApp\nWHERE favoriteApp.userName = ?1\nAND favoriteApp.favorite = TRUE\n") long countFavoritesForUser(String username) -
removeAllFavoritesOfApplication
@Transactional @Modifying(clearAutomatically=true, flushAutomatically=true) @Query("DELETE FROM FavoriteApplicationEntity favoriteApp\nWHERE favoriteApp.application.id = ?1\n") void removeAllFavoritesOfApplication(Long applicationId)
-