i have tried below code getting single notificationsubtype object. finding exception " org.apache.openjpa.persistence.argumentexception: encountered "from" @ character 1, expected: ["delete", "select", "update"]."
please me on given problem. code given below : ... ...
try { query query = this.em.createquery("from notificationsubtype conc conc.id.alerttyc = ?1 , conc.id.alertsubtyc = ?2"); query.setparameter(1, "mpprint"); query.setparameter(2, "rein"); notificationsubtype trackidreslst = (notificationsubtype)query.getsingleresult(); if (null != trackidreslst) { system.out.println("true"); } else{ system.out.println("false"); } } catch (exception e) { notificationlogger.errorwiththrowable(e); throw new notificationserviceexception(e.getmessage()); } ...
why not read exception? , read jpa spec ?
jpql statements have start select, update or delete. other illegal (and yours starts from reason). put select , candidate alias in front of more chance of success
yes hibernate bastardises jpql standard hql (which allows omit select plus alias) using openjpa need use jpa compliant queries, , besides practice when using hibernate obey standard!
Comments
Post a Comment