aboutsummaryrefslogtreecommitdiff
path: root/juick-server
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-01 20:02:34 +0300
committerGravatar Vitaly Takmazov2016-12-01 20:04:54 +0300
commitbdd36eb9858d0dccd94827de55e36767095be048 (patch)
treebd0670b59cd7a5fdd04cc8ba5d2f33a9c7bb4b3d /juick-server
parent2d5dfc2be23bbab03f8cba285d9255833d9b798c (diff)
juick-server: fix push queries annotations
Diffstat (limited to 'juick-server')
-rw-r--r--juick-server/src/main/java/com/juick/service/PushQueriesServiceImpl.java13
1 files changed, 12 insertions, 1 deletions
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<String> 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<String> getGCMTokens(final Collection<Integer> 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<String> 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<String> getMPNSTokens(final Collection<Integer> 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<String> 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<String> getAPNSTokens(final Collection<Integer> 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 (?, ?)",