This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
You can delete records using remove from the home interface like entityHome.remove(primaryKey); or you can lookup for the local/remote interface and call remove: entityLocal = entityHome.findByPrimaryKey(primaryKey); entityLocal.remove(); Updating records in CMP is done by updating the CMP fields using the set methods. That's the idea behind the CMP (RAD - Rapid Application Development). If you wanna write your own UPDADE/DELETE SQL statements, you can use BMP or Session Beans with JDBC. Sergiu.
EJB-QL is EJB-Query language..... Only for querying data. No insert/delete/update stmts. It would be a bad design to mix CMP and BMP code in an entity bean. In a CMP, the container is responsible to delete your data from the database.We do not have to write any delete stmts in the ejbRemove() method.