• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception on HQL Update

 
suresh kumar R
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai All,
I want to update a table using hql update, for which I tried to use the following HQL Update query.



But I end up with following exception, can any one help me out of this problem. The exception trace is given below

 
Halcon Guatemala
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Suresh, I'm not sure where is your userStatusMaster.userStatus attribute, is it in any associated class? Is userStatusMaster an UserMaster's attribute? I suggest you use alias for the classes involved in your HQL query.

Bye
 
suresh kumar R
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Halcon for your reply,
yeah... you are pretty right, UserStatusMaster is an associated class of UserMaster. Thus userStatusMaster is an attribute of UserMaster.
 
Halcon Guatemala
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again Suresh, sorry, my previous observations were pretty obvious. It seems like
[update UserMaster set cancelDate = :cancelDate, userStatusMaster.userStatus = :status where userId in (:users0_, :users1_)] isn't being reached by your query (org.hibernate.hql.ast.QuerySyntaxError: expecting EQ, found '.' near line 1, column 65). Can You post your mapping resources? I'm curious about your settings of cascade options.

Bye
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by suresh kumar R:

UserStatusMaster is an associated class of UserMaster. Thus userStatusMaster is an attribute of UserMaster.


In that case, shouldnt the query look like:

 
suresh kumar R
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai Halcon,
Hope this could be some use, in resolving the issue.




 
Halcon Guatemala
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again Suresh, does your UserStatusMaster class have any id? It doesn't seem like there is any problem with your association mapping but your (child) class must have any id. What is the code for to make persistent both objects?

Regards
 
suresh kumar R
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi halcon,
The UserStatusMaster class does have an id, actually I missed that in the code, Sorry for that.

Originally posted by Halcon Guatemala:
What is the code for to make persistent both objects?

did you mean the model classes?
 
Halcon Guatemala
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Suresh, sorry to be little explicit... what do statements do your persistence work? something like...

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic