entityManager.createNativeQuery("SELECT * FROM <my_entity_table>", MyEntity.class).getResultList();
Work for me!
thanks for the reply, but I still need to know if EJBQL allows random selection from the record.
for example, MySQL allows query:
select * from Table1 order by rand() limit 5;
I've searched half a day if EJBQL can do sucha thing but found no info.
Is there anyway I can select random records using EJBQL?
(My boss doesn't wanna use createNativeQuery. That make it more though...)