Hi , I am using hibernate for my DB actions.
My code is as follows:
oSession = getDBSession(); Transaction tx = oSession.beginTransaction(); String hql = "update ideadetails set status='" + oCInnovativeIdea.getIdeaState().getId() + "',remarks='" + oCInnovativeIdea.getRemarks() + "', public='" + oCInnovativeIdea.getIdeaPublic() + "' where id ='" + oCInnovativeIdea.getID() + "'"; Query query = oSession.createQuery(hql); int row = query.executeUpdate(); tx.commit();
And it is giving an error:
18:58:12,107 ERROR [PARSER] line 1:261: unexpected token: t 18:58:12,107 ERROR [PARSER] line 2:39: unexpected token: could 18:58:12,107 ERROR [PARSER] line 2:62: unexpected token: right 18:58:12,123 ERROR [PARSER] line 2:103: unexpected token: seems 18:58:12,123 ERROR [PARSER] line 4:23: unexpected token: less 18:58:12,123 ERROR [PARSER] line 4:52: expecting IDENT, found '800' 18:58:12,123 ERROR [PARSER] line 5:33: unexpected token: cost 18:58:12,123 ERROR [PARSER] line 5:51: expecting IDENT, found '', public='' 18:58:12,138 INFO [STDOUT] org.hibernate.QueryException: expecting ''', found ' <EOF>' [update ideadetails set status='11',remarks='Idea: Remote configuration o f Drives using GSM
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorI pl.java:204) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImp .java:111) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanC che.java:72) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessi nImpl.java:133)
Could any one help me with this problem....
|