java - JPA Map Query Result to Class -


i want map query result simple pojo , can't figure out how it.

for example, i've got following pojo:

public class testmapper {     private long tableaid;     private string tableavalue;      private long tablebid;     private string tablebvalue;     ... } 

now want simple query mapping class like:

list<testmapper> testmappers = entitymanager.createnativequery(     "select * tablea a, tableb b a.id = b.id",     testmapper.class ).getresultlist(); 

this query not make sense represents want do. keep getting exception:

exception description: missing descriptor [class testmapper] query: readallquery(referenceclass=testmapper sql="select * tablea a, tableb b a.id = b.id") 

what have do, solve issue?


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -