diff --git a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java index 38c1db8..c426315 100644 --- a/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java +++ b/src/main/java/org/gcube/portal/databook/server/DBCassandraAstyanaxImpl.java @@ -2440,11 +2440,19 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { /** * {@inheritDoc} */ + @Deprecated @Override - public List getAllLikesByPost(String feedid) { + public List getAllLikesByFeed(String feedid) { + return getAllLikesByPost(feedid); + } + /** + * {@inheritDoc} + */ + @Override + public List getAllLikesByPost(String postid) { List toReturn = new ArrayList(); OperationResult> result; - PreparedIndexExpression clause = cf_Likes.newIndexClause().whereColumn("Feedid").equals().value(feedid); + PreparedIndexExpression clause = cf_Likes.newIndexClause().whereColumn("Feedid").equals().value(postid); try { result = conn.getKeyspace().prepareQuery(cf_Likes) .searchWithIndex() @@ -2467,7 +2475,7 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore { else if (col.getName().compareTo("Feedid") == 0) toAdd.setFeedid(col.getStringValue()); else { - _log.error("getAllLikesByFeed(): Could not assign variable to this Like for column name: " + col.getName()); + _log.error("getAllLikesByPost(): Could not assign variable to this Like for column name: " + col.getName()); } } toReturn.add(toAdd); diff --git a/src/main/java/org/gcube/portal/databook/server/DatabookStore.java b/src/main/java/org/gcube/portal/databook/server/DatabookStore.java index b7bfaa8..9c15752 100644 --- a/src/main/java/org/gcube/portal/databook/server/DatabookStore.java +++ b/src/main/java/org/gcube/portal/databook/server/DatabookStore.java @@ -532,6 +532,12 @@ public interface DatabookStore { * @return the likes made to feeds in the range from: today to: timeInMillis */ List getRecentLikedPostsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException; + /** + * @deprecated use getAllLikesByPost + * @param postid postid identifier + * return all the likes belonging to the postid + */ + List getAllLikesByFeed(String postid); /** * @param postid postid identifier * return all the likes belonging to the postid