This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes HQL update query problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "HQL update query problem." Watch "HQL update query problem." New topic
Author

HQL update query problem.

Nagendra Shastry
Greenhorn

Joined: Oct 26, 2010
Posts: 19

I have 2 tables Asset and Asset_Dist_Types. Asset is parent and Asset_Dist_Types is a child table. Asset_Dist_Types is having 2 columns asset_id and lkp_dist_type where asset_id is the primary key in Asset table. In Asset_Dist_Types it is a many to many (one asset_id can have multiple lkp_dist_type entries.) In java, we have entity class only for Asset table. In that for Asset_Dist_Type, they have mentioned it as collection of elements. In Asset.java, entry for Asset_Dist_Type is as follows.



Now I would like to update Asset_Dist_Type table's lkp_dist_type column. I have list of asset id's. I have written following query to update it.



But this is throwing



Since I am new to hibernate I am not getting what is the solution. Can someone please help me?

 
Don't get me started about those stupid light bulbs.
 
subject: HQL update query problem.
 
Similar Threads
JPA - How to write correct HQL?
Firing Native Oracle Queries through hibernate
Retrieve record based on unique field
Simple JOIN in JPA proving difficult
Why is my Hibernate Search query not working?