← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7095: Simplified message sql

 

------------------------------------------------------------
revno: 7095
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-05-30 09:54:59 +0200
message:
  Simplified message sql
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/hibernate/HibernateMessageConversationStore.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/hibernate/HibernateMessageConversationStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/hibernate/HibernateMessageConversationStore.java	2012-02-15 17:10:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/message/hibernate/HibernateMessageConversationStore.java	2012-05-30 07:54:59 +0000
@@ -63,13 +63,7 @@
     public List<MessageConversation> getMessageConversations( User user, Integer first, Integer max )
     {
         String sql = 
-            "select mc.messageconversationid, mc.uid, mc.subject, mc.lastmessage, ui.surname, ui.firstname, ( " +
-                "select isread from usermessage " +
-                "where usermessage.usermessageid=mu.usermessageid " +
-                "and mu.messageconversationid=mc.messageconversationid ) as isread, ( " +
-                "select isfollowup from usermessage " + 
-                "where usermessage.usermessageid=mu.usermessageid " +
-                "and mu.messageconversationid=mc.messageconversationid ) as isfollowup " +
+            "select mc.messageconversationid, mc.uid, mc.subject, mc.lastmessage, ui.surname, ui.firstname, um.isread, um.isfollowup " +
             "from messageconversation mc " +
             "left join messageconversation_usermessages mu on mc.messageconversationid=mu.messageconversationid " +
             "left join usermessage um on mu.usermessageid=um.usermessageid " +