/** * Remove the entity instance. * * @param entity * @throws IllegalArgumentException * if the instance is not an entity or is a detached entity * @throws TransactionRequiredException * if invoked on a container-managed entity manager of type * PersistenceContextType.TRANSACTION and there is no * transaction */ @Override public final void remove(Object e) { checkClosed(); checkTransactionNeeded(); try { getPersistenceDelegator().remove(e); } catch (Exception ex) { // on rollback. doRollback(); throw new KunderaException(ex); } }
private void applyOperations(PersistenceDelegator pd, OToOOwnerEntity found, AssociationEntity association, boolean remove) { found.setAssociation(association); pd.merge(found); pd.doFlush(); pd.detach(association); pd.merge(found); // detach over association entity should work. if (remove) pd.remove(found); // since we have called merge, so association // entity should be in MANAGED_STATE and cascade // should work. } }
PropertyAccessorHelper.getId(result, this.getEntityMetadata())); persistenceDelegeator.remove(result);