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 Type
    Method
    Description
    long
     
    getFavoriteAppByUserNameAndAppId(Long applicationId, String userName)
     
    void
     

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods 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)