Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How To delete List of records

 
balaji anatha padmanaban
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I need to delete a list of records.I used the Query
String strQuery = "Select * from ORDER_EQUIPMENT_DETAIL where ORDER_ID= 1001 ";
query = HibernateUtil.createSQLQuery(strQuery);
List result = query.list();
Now I need to Delete the list.In This List it is having both OrderEquipmentDetailId.java and OrderEquipmentDetail.java records.While Iterating the records in the list I am confused,I need to typecast with
correct class or How to delete?
Please help.
Thanks.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just out of curiosity, why not query for the Order, then if you have cascade option set to include "delete" just clear out the Order's Collection of Order_equipment_detail, then saveOrUpdate() the order.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic