michael wrote:
"it failed" is not a sufficient description of your problem.
sorry.. i was thinking that somebody might post a codesample for that.
Below is the code i used
Code:
String hqlUpdate = "update Category set lft = lft + 2 where lft >2 ";
Query q = session.createQuery( hqlUpdate );
int updatedEntities = q.executeUpate();
it gave me an error
root0_0_, this_.name as name0_0_, this_.lft as lft0_0_, this_.rgt as rgt0_0_ from nested_category t
his_ where this_.rgt=? and this_.lft=? and this_.name=?
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxError: expecting DOT, found '=' near lin
e 1, column 25 [update Category set lft = lft + 2 where lft >2 ]
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:74)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:214)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:127)
................................................
can anyone pls give me a code sample for executing the query
thanks
boolee