-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: HQL Query Update problem
PostPosted: Thu Mar 30, 2006 4:24 am 
Newbie

Joined: Thu Jan 12, 2006 9:41 am
Posts: 15
Location: France
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 30, 2006 5:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
is this related to any tools ?

I think you should go to the user forum - and btw. the update should definitly not be executed if you receive that exception.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.