@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) { LOG.tracev( "Cascading to delete: {0}", entityName ); session.delete( entityName, child, isCascadeDeleteEnabled, (Set) anything ); }
public void remove() { if ( !single ) { throw new UnsupportedOperationException( "Not a single column hibernate query result set" ); } if ( currentResult == null ) { throw new IllegalStateException( "Called Iterator.remove() before next()" ); } if ( !( types[0] instanceof EntityType ) ) { throw new UnsupportedOperationException( "Not an entity" ); } session.delete( ( (EntityType) types[0] ).getAssociatedEntityName(), currentResult, false, null ); } }
/** * Delete any entities that were removed from the collection */ private static void deleteOrphans(EventSource eventSource, String entityName, PersistentCollection pc) throws HibernateException { //TODO: suck this logic into the collection! final Collection orphans; if ( pc.wasInitialized() ) { final CollectionEntry ce = eventSource.getPersistenceContext().getCollectionEntry( pc ); orphans = ce==null ? java.util.Collections.EMPTY_LIST : ce.getOrphans( entityName, pc ); } else { orphans = pc.getQueuedOrphans( entityName ); } for ( Object orphan : orphans ) { if ( orphan != null ) { LOG.tracev( "Deleting orphaned entity instance: {0}", entityName ); eventSource.delete( entityName, orphan, false, new HashSet() ); } } } }
eventSource.delete( entityName, loadedValue, isCascadeDeleteEnabled, new HashSet() );
public void delete(String paramString, Object paramObject) throws HibernateException { ((EventSource) delegate).delete(paramString, paramObject); }
public void delete(String paramString, Object paramObject, boolean paramBoolean, Set paramSet) { ((EventSource) delegate).delete(paramString, paramObject, paramBoolean, paramSet); }
@Override public void cascade(EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to delete: {0}", entityName ); session.delete( entityName, child, isCascadeDeleteEnabled, ( Set ) anything ); } @Override
@Override public void cascade(EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) throws HibernateException { LOG.tracev( "Cascading to delete: {0}", entityName ); session.delete( entityName, child, isCascadeDeleteEnabled, ( Set ) anything ); } @Override
@Override public void cascade( EventSource session, Object child, String entityName, Object anything, boolean isCascadeDeleteEnabled) { LOG.tracev( "Cascading to delete: {0}", entityName ); session.delete( entityName, child, isCascadeDeleteEnabled, (Set) anything ); }
public void remove() { if (!single) { throw new UnsupportedOperationException("Not a single column hibernate query result set"); } if (currentResult==null) { throw new IllegalStateException("Called Iterator.remove() before next()"); } if ( !( types[0] instanceof EntityType ) ) { throw new UnsupportedOperationException("Not an entity"); } session.delete( ( (EntityType) types[0] ).getAssociatedEntityName(), currentResult, false, null ); } }
public void remove() { if (!single) { throw new UnsupportedOperationException("Not a single column hibernate query result set"); } if (currentResult==null) { throw new IllegalStateException("Called Iterator.remove() before next()"); } if ( !( types[0] instanceof EntityType ) ) { throw new UnsupportedOperationException("Not an entity"); } session.delete( ( (EntityType) types[0] ).getAssociatedEntityName(), currentResult, false, null ); } }
/** * Delete any entities that were removed from the collection */ private void deleteOrphans(String entityName, PersistentCollection pc) throws HibernateException { //TODO: suck this logic into the collection! final Collection orphans; if ( pc.wasInitialized() ) { CollectionEntry ce = eventSource.getPersistenceContext().getCollectionEntry(pc); orphans = ce==null ? CollectionHelper.EMPTY_COLLECTION : ce.getOrphans(entityName, pc); } else { orphans = pc.getQueuedOrphans(entityName); } final Iterator orphanIter = orphans.iterator(); while ( orphanIter.hasNext() ) { Object orphan = orphanIter.next(); if (orphan!=null) { LOG.tracev( "Deleting orphaned entity instance: {0}", entityName ); eventSource.delete( entityName, orphan, false, new HashSet() ); } } } }
/** * Delete any entities that were removed from the collection */ private void deleteOrphans(String entityName, PersistentCollection pc) throws HibernateException { //TODO: suck this logic into the collection! final Collection orphans; if ( pc.wasInitialized() ) { CollectionEntry ce = eventSource.getPersistenceContext().getCollectionEntry(pc); orphans = ce==null ? CollectionHelper.EMPTY_COLLECTION : ce.getOrphans(entityName, pc); } else { orphans = pc.getQueuedOrphans(entityName); } final Iterator orphanIter = orphans.iterator(); while ( orphanIter.hasNext() ) { Object orphan = orphanIter.next(); if (orphan!=null) { LOG.tracev( "Deleting orphaned entity instance: {0}", entityName ); eventSource.delete( entityName, orphan, false, new HashSet() ); } } } }
/** * Delete any entities that were removed from the collection */ private static void deleteOrphans(EventSource eventSource, String entityName, PersistentCollection pc) throws HibernateException { //TODO: suck this logic into the collection! final Collection orphans; if ( pc.wasInitialized() ) { final CollectionEntry ce = eventSource.getPersistenceContext().getCollectionEntry( pc ); orphans = ce==null ? java.util.Collections.EMPTY_LIST : ce.getOrphans( entityName, pc ); } else { orphans = pc.getQueuedOrphans( entityName ); } for ( Object orphan : orphans ) { if ( orphan != null ) { LOG.tracev( "Deleting orphaned entity instance: {0}", entityName ); eventSource.delete( entityName, orphan, false, new HashSet() ); } } } }
LOG.tracev( "Deleting orphaned entity instance: {0}", description ); eventSource.delete( entityName, loadedValue, false, new HashSet() );
LOG.tracev( "Deleting orphaned entity instance: {0}", description ); eventSource.delete( entityName, loadedValue, false, new HashSet() );
eventSource.delete( entityName, loadedValue, isCascadeDeleteEnabled, new HashSet() );