public void destroy(StoragetabPK id) throws NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Storagetab storagetab;
try {
storagetab = em.getReference(Storagetab.class, id);
storagetab.getStoragetabPK();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The storagetab with id " + id + " no longer exists.", enfe);
}
Inventory inventoryID = storagetab.getInventoryID();
if (inventoryID != null) {
inventoryID.getStoragetabCollection().remove(storagetab);
inventoryID = em.merge(inventoryID);
}
Account account = storagetab.getAccount();
if (account != null) {
account.getStoragetabCollection().remove(storagetab);
account = em.merge(account);
}
em.remove(storagetab);