Skip to content

Commit 42114fb

Browse files
committed
SeriesDao.countAllStamps(): return 0 when there is no series.
Fixed displaying of index page where there is no series in database. Exception was: AopInvocationException: Null return value from advice does not match primitive return type for: public abstract long ru.mystamps.web.dao.SeriesDao.countAllStamps()
1 parent 3b57867 commit 42114fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/ru/mystamps/web/dao/SeriesDao.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ public interface SeriesDao extends CrudRepository<Series, Integer> {
3737
@Query("SELECT COUNT(*) FROM Series s INNER JOIN s.gibbons m WHERE m.code = :gibbonsCode")
3838
int countByGibbonsNumberCode(@Param("gibbonsCode") String gibbonsNumberCode);
3939

40-
@Query("SELECT SUM(quantity) FROM Series")
40+
@Query("SELECT COALESCE(SUM(quantity), 0) FROM Series")
4141
long countAllStamps();
4242
}

0 commit comments

Comments
 (0)