Changed name of db function to RecommendedEcoNews
@@ -23,7 +23,7 @@ public interface EcoNewsRepo extends JpaRepository<EcoNews, Long> {
/**
* Method for getting three recommended eco news.
- * Query is based on database function TAGS
+ * Query is based on database function RECOMMENDEDECONEWS
*
* @param countOfTags count of tags.
* @param firstTagId id of first tag.
@@ -32,7 +32,7 @@ public interface EcoNewsRepo extends JpaRepository<EcoNews, Long> {
* @param openedEcoNewsId id of opened eco news.
* @return list of three recommended {@link EcoNews} instances.
*/
- @Query(nativeQuery = true, value = "SELECT * FROM Tags(:countOfTags, :firstTagId, :secondTagId, :thirdTagId) "
+ @Query(nativeQuery = true, value = "SELECT * FROM RecommendedEcoNews(:countOfTags, :firstTagId, :secondTagId, :thirdTagId) "
+ "WHERE id <> :openedEcoNewsId limit 3")
List<EcoNews> getThreeRecommendedEcoNews(Integer countOfTags, Long firstTagId,
Long secondTagId, Long thirdTagId, Long openedEcoNewsId);
