Ormlite连接三个表

时间:2015-04-16 08:16:52

标签: sql sqlite join ormlite

我想在三个表上创建一个内连接,例如:

Select m.* 
From MessageInbox mi 
   Inner Join Message m ON mi.MessageId = m.Id 
   Left Join Message m2 ON 
      m.ConversationStarterMessageId = m2.ConversationStarterMessageId 
      AND m.MessageSendDate < m2.MessageSendDate 
Where 
     m2.MessageSendDate IS NULL 
     AND mi.Deleted = 0 
     AND mi.RemovedFromInbox = 0 
     AND mi.UserId = ?userId 
Order By m.MessageSendDate DESC

如何将其作为Ormlite查询编写?

0 个答案:

没有答案