Deleting data using a JPA entity
For default JPA entities, you can delete data from the HCL Commerce database
using the remove()
method on the access bean's interface. If you want to delete
your customized JPA entity, define a JPA DAO implementation that extends
AbstractJPAEntityDaoImpl
.
The following example attempts to delete the record that is contained in your JPA
entity.
try
{
EntityDao socialAccountDao = new SocialAccountDaoImpl();
socialAccountDao.remove(socialAccount);
}
catch( Exception e) {
//TODO handle exception
}