From bdd36eb9858d0dccd94827de55e36767095be048 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 1 Dec 2016 20:02:34 +0300 Subject: juick-server: fix push queries annotations --- .../main/java/com/juick/service/PushQueriesServiceImpl.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'juick-server/src/main/java/com/juick/service') diff --git a/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java b/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java index aca48a19..73f98abf 100644 --- a/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java @@ -15,7 +15,6 @@ import java.util.List; * Created by aalexeev on 11/13/16. */ @Repository -@Transactional(readOnly = true) public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueriesService { @Inject @@ -23,6 +22,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri super(jdbcTemplate, null); } + @Transactional(readOnly = true) @Override public List getGCMRegID(final int uid) { return getJdbcTemplate().queryForList( @@ -31,6 +31,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri uid); } + @Transactional(readOnly = true) @Override public List getGCMTokens(final Collection uids) { if (CollectionUtils.isEmpty(uids)) @@ -42,17 +43,20 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri String.class); } + @Transactional @Override public boolean addGCMToken(Integer uid, String token) { return getJdbcTemplate().update("INSERT IGNORE INTO android(user_id,regid) VALUES (?, ?)", uid, token) > 0; } + @Transactional @Override public boolean deleteGCMToken(String token) { return getJdbcTemplate().update("DELETE FROM android WHERE regid=?", token) > 0; } + @Transactional(readOnly = true) @Override public List getMPNSURL(final int uid) { return getJdbcTemplate().queryForList( @@ -61,6 +65,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri uid); } + @Transactional(readOnly = true) @Override public List getMPNSTokens(final Collection uids) { if (CollectionUtils.isEmpty(uids)) @@ -72,17 +77,20 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri String.class); } + @Transactional @Override public boolean addMPNSToken(Integer uid, String token) { return getJdbcTemplate().update("INSERT IGNORE INTO winphone(user_id,url) VALUES (?, ?)", uid, token) > 0; } + @Transactional @Override public boolean deleteMPNSToken(String token) { return getJdbcTemplate().update("DELETE FROM winphone WHERE url=?", token) > 0; } + @Transactional(readOnly = true) @Override public List getAPNSToken(final int uid) { return getJdbcTemplate().queryForList( @@ -91,11 +99,13 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri uid); } + @Transactional @Override public boolean deleteAPNSToken(String token) { return getJdbcTemplate().update("DELETE FROM ios WHERE token=?", token) > 0; } + @Transactional(readOnly = true) @Override public List getAPNSTokens(final Collection uids) { if (CollectionUtils.isEmpty(uids)) @@ -107,6 +117,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri String.class); } + @Transactional @Override public boolean addAPNSToken(Integer uid, String token) { return getJdbcTemplate().update("INSERT IGNORE INTO ios(user_id,token) VALUES (?, ?)", -- cgit v1.2.3