sqlite - ORMLite (Android) Please, help me drafting a request -


really need in drafting request ormlite (android) http://ormlite.com/.

there sql queries (namedquery):

1)select m.contact.stringid, count(m.contact.stringid) messageentityimpl m m.status = messagestatus.new group m.contact.stringid"

2)select m.chat_id, c.stringid, c.fullname, m.message, max(posted) postdate messageentity m inner join (select chat_id, max(posted) max_posted messageentity group chat_id) max_posted_date on m.chat_id = max_posted_date.chat_id , posted = max_posted_date.max_posted inner join contactentity c on c.id = m.contact_id group m.chat_id, c.stringid, c.fullname, m.message order postdate desc

you better off issuing raw query results (as genericrawresults<t>) , traversing through container required results. here's example -

string sql = "select m.contact.stringid messageentityimpl m m.status = messagestatus.new group m.contact.stringid";  arraylist<string> id = new arraylist<>();  try {     genericrawresults<string[]> grr = getdao().queryraw(sql);     list<string[]> results = grr.getresults();     (string[] outarray : results)         id.add (outarray[0]); } catch (sqlexception sqle) {     sqle.printstacktrace(); } 

getdao() can basedaoimpl<t,id>.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -