better idea for deleteSelected, with a real delete query (that's faster):

Vector idsToDelete = new Vector();
  | 
  | for (Item item: listOfItems)
  |     if(item.isDelete())
  |         idsToDelete.add(item.getId());
  | 
  | if (idsToDelete.size() == 0)
  |     return null;
  | 
  | String ids = idsToDelete.toString(); //e.g. [1,4,5]
  | ids = ids.substring(1, ids.length()-1); //e.g. 1,4,5 (brackets removed)
  | 
  | String query = "delete from Item where id in (" + ids + ")";
  | em.createQuery(query).executeUpdate();

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968601#3968601

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968601
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to