specify order by m.id

remove @SuppressWarnings("unchecked")