aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service/MessagesServiceImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/service/MessagesServiceImpl.java')
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java
index efe480c0..145d42c3 100644
--- a/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -343,7 +343,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
@Transactional(readOnly = true)
@Override
- public com.juick.Message getMessage(final int mid) {
+ public Optional<com.juick.Message> getMessage(final int mid) {
List<com.juick.Message> list = getJdbcTemplate().query(
"SELECT messages.message_id as mid, 0 as rid, 0 as replyto, "
@@ -369,9 +369,9 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
Map<Integer, Set<Reaction>> reactionStats = updateReactionsFor(Collections.singletonList(mid));
message.setReactions(reactionStats.get(message.getMid()));
message.setEntities(MessageUtils.getEntities(message));
- return message;
+ return Optional.of(message);
}
- return null;
+ return Optional.empty();
}
@Transactional(readOnly = true)