You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have search in issues with keyword "queryRaw", but no similar question is find. scene
I want to get a RecentContact list from a table of chat record.
The chat bean has fields : sn(as id), targetId, srcId, content, time and ...
for once query, i used raw query:
.getChatBeanDao()
.queryRaw(" WHERE T.TIME IN" +
" (" +
" SELECT MAX(TIME)" +
" FROM CHAT_BEAN" +
" WHERE SRC_ID = " + userId +
" GROUP BY TARGET_ID" +
" )" +
" GROUP BY TIME" //time unit is second, maybe has several in one second
);
It is confused.
When i insert these records in local, and query by the same code, result is unique. Which means i can't reproduce it. more
nearby the code with problem, another query also is right:
queryBuilder
.where(
ChatBeanDao.Properties.SrcId.eq(myUserId),
ChatBeanDao.Properties.TargetId.eq(targetUserId),
)
.orderDesc(ChatBeanDao.Properties.Time)
.limit(1)
.unique();
// result
17:16:40.455
: last unread is ChatBean{sn=2, targetId=213, srcId=321, content='😔', time=1580979934}
The time only passed 150 milliseconds
Could anyone tell me some ways to solve it ? thank you
The text was updated successfully, but these errors were encountered:
I have search in issues with keyword "queryRaw", but no similar question is find.
scene
I want to get a RecentContact list from a table of chat record.
The chat bean has fields : sn(as id), targetId, srcId, content, time and ...
for once query, i used raw query:
problem
Now i find a result log like this:
It is confused.
When i insert these records in local, and query by the same code, result is unique. Which means i can't reproduce it.
more
nearby the code with problem, another query also is right:
The time only passed 150 milliseconds
Could anyone tell me some ways to solve it ? thank you
The text was updated successfully, but these errors were encountered: