@Override public void postAction() { clearOperationQueue(); cachedSize = -1; clearDirty(); }
/** * After reading all existing elements from the database, * add the queued elements to the underlying collection. */ protected final void performQueuedOperations() { for ( DelayedOperation operation : operationQueue ) { operation.operate(); } clearOperationQueue(); }
@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() ); } } }
/** * After reading all existing elements from the database, * add the queued elements to the underlying collection. */ protected final void performQueuedOperations() { for ( DelayedOperation operation : operationQueue ) { operation.operate(); } clearOperationQueue(); }
@Override public void postAction() { clearOperationQueue(); cachedSize = -1; clearDirty(); }