Package io.meeds.appcenter.dao
Interface ApplicationDAO
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<ApplicationEntity,,Long> org.springframework.data.jpa.repository.JpaRepository<ApplicationEntity,,Long> org.springframework.data.repository.ListCrudRepository<ApplicationEntity,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<ApplicationEntity,,Long> org.springframework.data.repository.PagingAndSortingRepository<ApplicationEntity,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<ApplicationEntity>,org.springframework.data.repository.Repository<ApplicationEntity,Long>
@Component
public interface ApplicationDAO
extends org.springframework.data.jpa.repository.JpaRepository<ApplicationEntity,Long>
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<ApplicationEntity> findAll()org.springframework.data.domain.Page<FavoriteApplicationEntity> findFavoriteAndMandatoryApplications(String userName, org.springframework.data.domain.Pageable pageable) getApplicationByTitle(String title) default List<ApplicationEntity> default List<ApplicationEntity> getApplications(String keyword) getApplications(String keyword, org.springframework.data.domain.Sort sort) getApplications(org.springframework.data.domain.Sort sort) 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
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
-
getMandatoryActiveApps
@Query("SELECT app FROM ApplicationEntity app\nWHERE app.active = TRUE\nAND app.isMandatory = TRUE\n") List<ApplicationEntity> getMandatoryActiveApps() -
getApplications
@Query("SELECT app FROM ApplicationEntity app\n") List<ApplicationEntity> getApplications(org.springframework.data.domain.Sort sort) -
getApplications
-
getApplications
@Query("SELECT app FROM ApplicationEntity app\nWHERE LOWER(app.title) LIKE %?1%\nOR LOWER(app.description) like %?1%\nOR LOWER(app.url) LIKE %?1%\nORDER BY LOWER(app.title)\n") List<ApplicationEntity> getApplications(String keyword, org.springframework.data.domain.Sort sort) -
getApplications
-
getSystemApplications
@Query("SELECT app FROM ApplicationEntity app\nWHERE app.system = TRUE\n") List<ApplicationEntity> getSystemApplications() -
getApplicationByTitle
@Query("SELECT app FROM ApplicationEntity app\nWHERE app.title = ?1\n") ApplicationEntity getApplicationByTitle(String title) -
findAll
- Specified by:
findAllin interfaceorg.springframework.data.repository.CrudRepository<ApplicationEntity,Long> - Specified by:
findAllin interfaceorg.springframework.data.repository.ListCrudRepository<ApplicationEntity,Long>
-
findFavoriteAndMandatoryApplications
@Query("SELECT new FavoriteApplicationEntity(favoriteApp.id, app, favoriteApp.userName, favoriteApp.order)\nFROM ApplicationEntity app\nLEFT JOIN FavoriteApplicationEntity favoriteApp ON app.id = favoriteApp.application.id AND favoriteApp.userName = :userName\nWHERE app.active = TRUE AND (app.isMandatory = TRUE OR favoriteApp.id IS NOT NULL)\nORDER BY favoriteApp.order NULLS LAST, app.isMandatory DESC\n") org.springframework.data.domain.Page<FavoriteApplicationEntity> findFavoriteAndMandatoryApplications(@Param("userName") String userName, org.springframework.data.domain.Pageable pageable)
-