I am observing some change the way update HQL's are working. With hibernate version 3.1.3 the alias'es on update statement are working.
Code:
String hql = "update MyPersistentPojo myPojo set myPojo.propertyOne = ?, myPojo.propertyTwo = ? where myPojo.primaryKey = ?";
Object[] values = new Object[]{ propertyOneObj, propertyTwoObj, primaryKeyObj };
// these are hibernate Type's
StringType stype = new StringType();
DateType dtype = new DateType();
LongType ltype = new LongType();
Type[] types = new Type[]{ stype, dtype, ltype };
Query query = session.createQuery( hql );
query.setParameters( values, types );
List results = query.list();
However the same Query with Hibernate version 3.0.3 is not working and getting exception as in original post
org.hibernate.hql.ast.QuerySyntaxError: expecting "set", found 'myPojo'
Solution: Removing the alias in the HQL statment is working pretty fine, though.
Is there any difference regarding this alias'es feature between the two versions?
Is there any tweak to make the 3.0.3 HQL's work similar to 3.1.3 version using alias'es?
If anyone has came across such difference with HQL's could you please help me in getting some information.