0
我不能找出爲什麼總是拋出此表達一個NullPointerException:Hibernate的HQL的createQuery NullPointerException異常
String jpql = "DELETE Trend t WHERE t.owner = :owner AND t.shapeId = :shapeid AND t.security = :security AND t.timeframe = :timeframe";
int rows = 0;
try {
Query q = em.createQuery(jpql, Trend.class); // this line throw the exception
...
其他請求成功執行。
Thx,但爲什麼不應該使用沒有Class參數的createQuery? –
這對我很有用,我發現它沒有class arg。在官方文檔中也是如此.. http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/batch.html#batch-direct –