Created
August 22, 2013 09:27
-
-
Save syst3mw0rm/6305062 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<Tweet> fetchOlderFeeds(Long user_id, Long tweet_id) { | |
List<Tweet> tweetList = jdbcTemplate.query("select t.* from tweet t INNER JOIN following f ON (f.user_id2 = t.user_id) " + | |
"WHERE t.tweet_id < ? AND f.user_id1 = ? " + | |
"UNION ALL SELECT * FROM tweet t WHERE t.user_id=? AND t.tweet_id < ? " + | |
"ORDER BY tweet_id desc limit 15", | |
new Object[]{tweet_id, user_id, user_id, tweet_id}, new BeanPropertyRowMapper<>(Tweet.class)); | |
return tweetList; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment