Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting JPA query parsing error during parsing the subquery

 
sandeep gup
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
StringBuffer query = new StringBuffer();
query
.append("SELECT e FROM DBMGPersonMetaData e WHERE e.moduleUniqueId.extension= ?1 AND e.ConsType ");
query
.append("IN ( SELECT CASE WHEN " +
"INSTR(p.description, ' ') =0 "
+ " THEN SUBSTR(p.description,1) "
+ " WHEN INSTR(p.description, ' ') !=0 "
+ " THEN SUBSTR(p.description,1,INSTR(p.description, ' ')-1) END"
+ " AS ee FROM DBProjectMetaData p WHERE p.projectUniqueId.extension= ?2");
dbModuleperson = (DBMGPersonMetaData) entityManager.createQuery(
query.toString()).setParameter(1,"12").setParameter(2,"123").getSingleresult;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic