java - Not able to run hibernate query because of Syntax exception -


query working mysql. can me correct syntax in hibernate?

query query = entitymanager.createquery("delete hierarchydata id in (select c.id (select h.id hierarchydata h h.publicid in (select s.publicid hierarchydata s group s.publicid having count(s.publicid)>1) , h.id not in (select m.id hierarchydata m group m.publicid having count(m.publicid)>1 order m.id desc) order h.publicid) c)"); 

use entitymanager.createnativequery(string) create query sql string.

createquery(string) instead have used jpql string.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -