@Override public void execute() throws HibernateException { // this QueuedOperationCollectionAction has to be executed before any other // CollectionAction involving the same collection. getPersister().processQueuedOps( getCollection(), getKey(), getSession() ); // TODO: It would be nice if this could be done safely by CollectionPersister#processQueuedOps; // Can't change the SPI to do this though. ((AbstractPersistentCollection) getCollection() ).clearOperationQueue(); // The other CollectionAction types call CollectionEntry#afterAction, which // clears the dirty flag. We don't want to call CollectionEntry#afterAction unless // there is no other CollectionAction that will be executed on the same collection. final CollectionEntry ce = getSession().getPersistenceContext().getCollectionEntry( getCollection() ); if ( !ce.isDoremove() && !ce.isDoupdate() && !ce.isDorecreate() ) { ce.afterAction( getCollection() ); } } }
@Override public void execute() throws HibernateException { // this method is called when a new non-null collection is persisted // or when an existing (non-null) collection is moved to a new owner final PersistentCollection collection = getCollection(); preRecreate(); getPersister().recreate( collection, getKey(), getSession() ); getSession().getPersistenceContext().getCollectionEntry( collection ).afterAction( collection ); evict(); postRecreate(); if ( getSession().getFactory().getStatistics().isStatisticsEnabled() ) { getSession().getFactory().getStatistics().recreateCollection( getPersister().getRole() ); } }
@Override public void execute() throws HibernateException { preRemove(); if ( !emptySnapshot ) { // an existing collection that was either non-empty or uninitialized // is replaced by null or a different collection // (if the collection is uninitialized, hibernate has no way of // knowing if the collection is actually empty without querying the db) getPersister().remove( getKey(), getSession() ); } final PersistentCollection collection = getCollection(); if ( collection != null ) { getSession().getPersistenceContext().getCollectionEntry( collection ).afterAction( collection ); } evict(); postRemove(); if ( getSession().getFactory().getStatistics().isStatisticsEnabled() ) { getSession().getFactory().getStatistics().removeCollection( getPersister().getRole() ); } }
getSession().getPersistenceContext().getCollectionEntry( collection ).afterAction( collection ); evict(); postUpdate();
@Override public void execute() throws HibernateException { // this method is called when a new non-null collection is persisted // or when an existing (non-null) collection is moved to a new owner final PersistentCollection collection = getCollection(); preRecreate(); getPersistentCollectionDescriptor().recreate( collection, getKey(), getSession() ); getSession().getPersistenceContext().getCollectionEntry( collection ).afterAction( collection ); evict(); postRecreate(); if ( getSession().getFactory().getStatistics().isStatisticsEnabled() ) { getSession().getFactory().getStatistics().recreateCollection( getPersistentCollectionDescriptor().getNavigableRole().getNavigableName() ); } }
@Override public void execute() throws HibernateException { // this method is called when a new non-null collection is persisted // or when an existing (non-null) collection is moved to a new owner final PersistentCollection collection = getCollection(); preRecreate(); getPersister().recreate( collection, getKey(), getSession() ); getSession().getPersistenceContext() .getCollectionEntry(collection) .afterAction(collection); evict(); postRecreate(); if ( getSession().getFactory().getStatistics().isStatisticsEnabled() ) { getSession().getFactory().getStatisticsImplementor() .recreateCollection( getPersister().getRole() ); } }
@Override public void execute() throws HibernateException { // this method is called when a new non-null collection is persisted // or when an existing (non-null) collection is moved to a new owner final PersistentCollection collection = getCollection(); preRecreate(); getPersister().recreate( collection, getKey(), getSession() ); getSession().getPersistenceContext() .getCollectionEntry(collection) .afterAction(collection); evict(); postRecreate(); if ( getSession().getFactory().getStatistics().isStatisticsEnabled() ) { getSession().getFactory().getStatisticsImplementor() .recreateCollection( getPersister().getRole() ); } }
@Override public void execute() throws HibernateException { preRemove(); if ( !emptySnapshot ) { // an existing collection that was either non-empty or uninitialized // is replaced by null or a different collection // (if the collection is uninitialized, hibernate has no way of // knowing if the collection is actually empty without querying the db) getPersistentCollectionDescriptor().remove( getKey(), getSession() ); } final PersistentCollection collection = getCollection(); if ( collection != null ) { getSession().getPersistenceContext().getCollectionEntry( collection ).afterAction( collection ); } evict(); postRemove(); if ( getSession().getFactory().getStatistics().isStatisticsEnabled() ) { getSession().getFactory().getStatistics().removeCollection( getPersistentCollectionDescriptor().getNavigableRole().getFullPath() ); } }
@Override public void execute() throws HibernateException { preRemove(); if ( !emptySnapshot ) { // an existing collection that was either non-empty or uninitialized // is replaced by null or a different collection // (if the collection is uninitialized, hibernate has no way of // knowing if the collection is actually empty without querying the db) getPersister().remove( getKey(), getSession() ); } final PersistentCollection collection = getCollection(); if (collection!=null) { getSession().getPersistenceContext() .getCollectionEntry(collection) .afterAction(collection); } evict(); postRemove(); if ( getSession().getFactory().getStatistics().isStatisticsEnabled() ) { getSession().getFactory().getStatisticsImplementor() .removeCollection( getPersister().getRole() ); } }
@Override public void execute() throws HibernateException { preRemove(); if ( !emptySnapshot ) { // an existing collection that was either non-empty or uninitialized // is replaced by null or a different collection // (if the collection is uninitialized, hibernate has no way of // knowing if the collection is actually empty without querying the db) getPersister().remove( getKey(), getSession() ); } final PersistentCollection collection = getCollection(); if (collection!=null) { getSession().getPersistenceContext() .getCollectionEntry(collection) .afterAction(collection); } evict(); postRemove(); if ( getSession().getFactory().getStatistics().isStatisticsEnabled() ) { getSession().getFactory().getStatisticsImplementor() .removeCollection( getPersister().getRole() ); } }
getSession().getPersistenceContext().getCollectionEntry( collection ).afterAction( collection ); evict(); postUpdate();