parsing error in jpa query getting parsing error -


stringbuffer query = new stringbuffer(); query.append("select e dbmgpersonmetadata e     e.moduleuniqueid.extension= ?1 , e.constype ");  query.append("in ( select  case when " +"instr(p.description, ' ') = 0  "+ "   substr(p.description,1)   "+ " when instr(p.description, ' ') !=0 "+ "   substr(p.description,1,instr(p.description, ' ')-1)  end"+ " ee  dbprojectmetadata p p.projectuniqueid.extension= ?2"); dbmoduleperson = (dbmgpersonmetadata)  entitymanager.createquery(query.tostring()).setparameter(1,"12"). setparameter(2,"12").getsingleresult(); 

in order run native sql query in jpa, should use method instead:

entitymanager.createnativequery(query.tostring()); 

the method you're using (createquery) accepts either jpql query or criteriaquery.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -