how can i remove more than one row in a database

Discussions

EJB design: how can i remove more than one row in a database

  1. hi friends,

      i have adoubt .using ejbRemove() of entity bean (cmp) how can i remove more than ane records from database depending on condition .for example i vave table with column 'no'.i want to remove records satisfying condition no>5 like that.please respond me if u have an idia.
    hope it is clear.
    kishore peram
  2. u need to write a find by method which returns a enumeration (or collection) of rows which have no > 5 then for each item in the collection call its remove method which will delete the rows from the database.
  3. thanks ,but one as u sugested i have to call the ejbremove() method no. of times using loop insted of calling one time. am i catch ur point correctly.reply for it please
    kishore.
  4. You can bypass the entity bean and code the sql directly in a session bean. There is nothing wrong with this approach.
  5. sorry i can't catch ur point perfectly.please give me some details if u feel free.thanks
  6. Hey,
    If we bypass entities and update thro session,then we will end up with dirty entities !.How to overcome that?!.
  7. if u think thats a bit too much then u can try what Aaron Robinson has suggested...