Hi,
I try to make an update using HQL and I have the following exception :
org.hibernate.hql.ast.QuerySyntaxError: expecting "set", found 'centrale' near line 1, column 53 [update com.steria.varese.model.physique.PhyCentrale centrale set centrale.phyGeh.id = :idGeh where centrale.phySiteProduction.id = :idSiteProduction ]
this is the code:
Code:
public final static String QUERY_UPDATE_CENTRALE_WITH_GEH = "update "
+ PhyCentrale.class.getName() + " centrale"
+ " set centrale.phyGeh.id = :idGeh "
+ " where centrale.phySiteProduction.id = :idSiteProduction ";
public void changementGeh(PhyCentrale instance){
getSession().createQuery(QUERY_UPDATE_CENTRALE_WITH_GEH)
.setInteger("idSiteProduction",instance.getPhySiteProduction().getId().intValue())
.setInteger("idGeh",instance.getPhyGeh().getId().intValue())
.executeUpdate();
}
Even if there is an exception, the update is done in the database. But the exception disturbs me!!! Can anybody help me?
Thank you for your assistance.