title: android Sugar ORM select Query , Android
body: <p>I'm using <a href="https://github.com/satyan/sugar" rel="nofollow">Sugar ORm</a> and need to use folloing query :</p>
  
  <pre><code>public void selectByfriendId(String fId , int lastMsgId){
     select from table where (senderId = fId or receiverId = fId) and 
                             ( show = "1" and msg_Id &gt; lastMsgId)
  }
  </code></pre>
  
  <p>And That5 Is My Method :</p>
  
  <pre><code>public List&lt;Chat&gt; selectById(String cId , String fId , int lastMsgId){
      Select showChats = Select.from(Chat.class)
              .where(Condition.prop("senderid").eq(fId) ,
              Condition.prop("show").eq("1") , Condition.prop("msg_Id").gt(lastMsgId))
              .or(Condition.prop("receiverid").eq(fId), Condition.prop("show").eq("1") , 
              Condition.prop("msg_Id").gt(lastMsgId));
      Log.v(G.Logs.DB , "MessagesStack DataBase.SelectById showChats.list().size : " + showChats.list().size());
      return  showChats.list();
  }
  </code></pre>
  
  <p>And tried this One :</p>
  
  <pre><code>    List&lt;Chat&gt; array = Chat.find(Chat.class , "(senderid = ? OR receiverid = ?) AND (show = ? AND msg_Id &gt; ?)", fId , fId , "1" , ""+lastMsgId);
  </code></pre>
  
  <p>but it shows me whole rows in table</p>